/* ═══════════════════════════════════════════════════════════════════════════════════════════════
 * Hotbar gemelo del hábitat e Inventario de consola (orden de paridad artística de Dirección, 2026-11-06;
 * reemplaza el dock v534, ficha v534_dock_svg-plano-sin-chasis).
 * Dock: 5 fichas con el MISMO chasis que .hud-slot[data-rareza] (perfil-fashion.css), pintado en .hab-ficha::before
 * para que la inclinación 3D del marco no remuestree el sprite (V-21). La ficha no usa la clase .hud-slot porque el
 * JS la trata como pestaña; número y rótulo sí usan .hud-slot-num y .hud-slot-label para compartir tipografía.
 * Orden en teléfono: la tarjeta de identidad encabeza, en todo rol y vista (§7.282, bloque «Teléfono» de este archivo).
 * Movimiento: solo transform y opacity, curvas oficiales y steps() para las tiras (§6.1, §6.2, §6.3).
 * Guardas de 4 ids sobre las capas v470, v497 y las de skin (.pf-section button, con important).
 * ═══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Barra: misma caja que .hud-hotbar. Cristal liso, sin rejilla (V-41). ── */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock {
  --hab-u: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
  max-width: none;
  margin: 0.35rem 0 0;
  padding: 0.55rem;
  align-items: stretch;
  flex-wrap: nowrap;
  overflow: hidden;
  background: rgba(6, 6, 10, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1.1rem;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.06),
    inset 0 -2px 8px rgba(0, 0, 0, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}
/* El mismo barrido de luz que cruza la barra de arriba, en el compositor. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, color-mix(in srgb, var(--power-accent, #ff2a3d) 16%, transparent) 50%, transparent 100%);
  transform: translate3d(-120%, 0, 0);
  animation: hudBarridoCyber 7s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  mix-blend-mode: screen;
}
/* Skins: las dos barras se pintan igual. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d)[data-power-accent="cyan"] body.power-hud .power-console-dock.hab-dock {
  background: var(--cp-especular), var(--cp-vidrio) !important;
  border-color: rgba(var(--cp-cian), 0.5) !important;
  box-shadow: inset 0 1px 0 rgba(236, 254, 255, 0.2), inset 0 0 14px rgba(var(--cp-cian), 0.12), 0 0 14px rgba(var(--cp-cian), 0.3) !important;
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d)[data-power-accent="bubble"] body.power-hud .power-console-dock.hab-dock {
  border-color: rgba(255, 140, 220, 0.42) !important;
  box-shadow: inset 0 1px 0 rgba(255, 230, 250, 0.22), 0 0 14px rgba(255, 90, 200, 0.26), 0 -10px 28px -18px rgba(150, 100, 255, 0.6) !important;
}
/* El dock solo existe en el perfil propio y se sigue ocultando con los paneles de Skin, Hábitat y Deco (R220, R225). */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d):not([data-pf-cmd="propio"]) body .power-console-dock.hab-dock,
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="decoracion"], [data-hud-slot="fondo"]) .power-console-dock.hab-dock {
  display: none;
}

/* ── Ficha: la caja. Cada una tiene su columna y su punto de fuga, el mismo que le da a la de arriba
      la perspectiva única de .hud-hotbar. Se pinta en el primer cuadro, antes de que perfil.js quite
      la clase hidden de ARCADE: el dock solo se muestra en el perfil propio (V-01). ── */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha {
  --hab-luz: 34, 211, 238;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: 68px;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: inherit;
  text-align: center;
  font: inherit;
  letter-spacing: normal;
  clip-path: none !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: none !important;
  box-shadow: none !important;
  filter: none;
  perspective: 640px;
  perspective-origin: var(--hab-fuga, 50%) 0%;
  transform: none;
  transition: transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #hud-tokens-self { grid-column: 1; --hab-fuga: 268%; --hab-num-x: 18px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #btn-arcade-zone { grid-column: 2; --hab-fuga: 159%; --hab-num-x: 10px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #btn-inventario { grid-column: 3; --hab-fuga: 50%; --hab-num-x: 3px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > [data-libre="1"] { grid-column: 4; --hab-fuga: -59%; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > [data-libre="2"] { grid-column: 5; --hab-fuga: -168%; }

/* ── Chasis: valores de .hud-hotbar .hud-slot[data-rareza] (común). ── */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  width: auto;
  height: auto;
  margin: 0;
  pointer-events: none;
  box-sizing: border-box;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.03) 28%, transparent 46%),
    linear-gradient(180deg, rgba(var(--hab-luz), 0.12) 0%, transparent 38%, rgba(0, 0, 0, 0.35) 100%),
    radial-gradient(120% 80% at 50% 110%, rgba(var(--hab-luz), 0.22), transparent 60%),
    rgba(9, 10, 16, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(var(--hab-luz), 0.7);
  border-radius: 12px;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.28),
    inset -1px -2px 0 rgba(0, 0, 0, 0.65),
    inset 0 0 14px rgba(var(--hab-luz), 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 10px 18px -6px rgba(0, 0, 0, 0.75),
    0 0 16px rgba(var(--hab-luz), 0.38);
  opacity: 1;
  transform: rotateX(12deg) translateZ(0);
  transform-origin: 50% 100%;
  transition: transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: none;
}
/* Las capas de skin y de v470 no le cuelgan nada más a la ficha. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha::after { content: none !important; }

/* Número y rótulo: mismos valores que la ficha de arriba. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha .hud-slot-num {
  left: calc(0.38rem + var(--hab-num-x, 0px) * (var(--hab-u) - 1));
  top: calc(0.28rem + 4px * (var(--hab-u) - 1));
  color: rgb(var(--hab-luz));
  text-shadow: 0 0 8px rgba(var(--hab-luz), 0.9);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha .hud-slot-label {
  position: relative;
  z-index: 2;
  color: #f4f4f5;
  text-shadow: 0 0 6px rgba(var(--hab-luz), 0.75);
  letter-spacing: 0.14em;
}

/* Acciones: se levanta o se hunde como la de arriba. Área táctil de la ficha: 54 a 68 px de alto en teléfono. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > button.hab-ficha { cursor: pointer; touch-action: manipulation; }
@media (hover: hover) {
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > button.hab-ficha:hover { transform: translate3d(0, -4px, 0); }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > button.hab-ficha:hover::before { transform: rotateX(0deg) translateZ(0); }
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > button.hab-ficha:active { transform: scale(0.95); filter: brightness(1.15); }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > button.hab-ficha:active::before { transform: rotateX(4deg) translateZ(0); }
.hab-dock > button.hab-ficha:focus-visible { outline: 2px solid var(--power-accent, #ff2a3d); outline-offset: 2px; }

/* ── Sprites del dock: una ventana y, adentro, la tira que se corre con steps(). Escala entera (--hab-u). ── */
.hab-spr {
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 1;
  display: block;
  width: calc(32px * var(--hab-u));
  height: calc(32px * var(--hab-u));
  margin-left: calc(-16px * var(--hab-u));
  overflow: hidden;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.7));
}
/* Placa de obsidiana: el mismo zócalo que dibuja hotbar-viva.js en la ficha de arriba (44×44 lógicos, bandas de su paleta,
   filo de acento en la fila 33 y dos remaches de latón). Bandas duras a múltiplos enteros de --hab-p, sin difuminados (V-26). */
.hab-placa {
  --hab-p: 1px;
  --hab-ac: var(--power-accent, #ff2a3d);
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 0;
  width: calc(44 * var(--hab-p));
  height: calc(44 * var(--hab-p));
  margin-left: calc(-22 * var(--hab-p));
  pointer-events: none;
  clip-path: polygon(calc(3 * var(--hab-p)) 0, calc(100% - 3 * var(--hab-p)) 0, 100% calc(3 * var(--hab-p)), 100% calc(100% - 3 * var(--hab-p)), calc(100% - 3 * var(--hab-p)) 100%, calc(3 * var(--hab-p)) 100%, 0 calc(100% - 3 * var(--hab-p)), 0 calc(3 * var(--hab-p)));
  background:
    linear-gradient(#c9a35a, #c9a35a) calc(3 * var(--hab-p)) calc(3 * var(--hab-p)) / var(--hab-p) var(--hab-p) no-repeat,
    linear-gradient(#5e4a26, #5e4a26) calc(3 * var(--hab-p)) calc(4 * var(--hab-p)) / var(--hab-p) var(--hab-p) no-repeat,
    linear-gradient(#c9a35a, #c9a35a) calc(100% - 3 * var(--hab-p)) calc(3 * var(--hab-p)) / var(--hab-p) var(--hab-p) no-repeat,
    linear-gradient(#5e4a26, #5e4a26) calc(100% - 3 * var(--hab-p)) calc(4 * var(--hab-p)) / var(--hab-p) var(--hab-p) no-repeat,
    linear-gradient(180deg,
      #58527a 0 var(--hab-p),
      #2f2b45 var(--hab-p) calc(2 * var(--hab-p)),
      #1d1a2b calc(2 * var(--hab-p)) calc(8 * var(--hab-p)),
      #191725 calc(8 * var(--hab-p)) calc(16 * var(--hab-p)),
      #161420 calc(16 * var(--hab-p)) calc(24 * var(--hab-p)),
      #13111c calc(24 * var(--hab-p)) calc(33 * var(--hab-p)),
      var(--hab-ac) calc(33 * var(--hab-p)) calc(34 * var(--hab-p)),
      color-mix(in srgb, var(--hab-ac) 28%, #07060c) calc(34 * var(--hab-p)) calc(35 * var(--hab-p)),
      #100e17 calc(35 * var(--hab-p)) calc(42 * var(--hab-p)),
      #07060b calc(42 * var(--hab-p)) 100%);
  box-shadow: inset var(--hab-p) 0 0 #2b2740, inset calc(-1 * var(--hab-p)) 0 0 #110f19;
}
.hab-spr::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--hab-tira, 1) * 32px * var(--hab-u));
  height: calc(32px * var(--hab-u));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.hab-spr-moneda { --hab-tira: 8; }
.hab-spr-moneda::before {
  background-image: url("../../public/assets/sprites/ui/hab/dock_power_coin.png");
  animation: habTira8 2400ms steps(8, end) infinite;
}
.hab-spr-arcade { --hab-tira: 4; }
.hab-spr-arcade::before {
  background-image: url("../../public/assets/sprites/ui/hab/dock_arcade.png");
  animation: habTira4 1200ms steps(4, end) infinite;
}
.hab-spr-mochila { --hab-tira: 4; }
.hab-spr-mochila::before { background-image: url("../../public/assets/sprites/ui/hab/dock_mochila.png"); }
/* Al pulsar: cuadros 1 a 3 y vuelve al reposo. a y b son gemelos para poder repetirla (R202). */
#btn-inventario[data-pulso="a"] .hab-spr-mochila::before { animation: habMochilaA 300ms steps(3, end) 1; }
#btn-inventario[data-pulso="b"] .hab-spr-mochila::before { animation: habMochilaB 300ms steps(3, end) 1; }
.hab-spr-cartucho::before { background-image: url("../../public/assets/sprites/ui/hab/dock_cartucho.png"); }
@keyframes habTira8 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-256px * var(--hab-u)), 0, 0); }
}
@keyframes habTira4 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-128px * var(--hab-u)), 0, 0); }
}
@keyframes habMochilaA {
  from { transform: translate3d(calc(-32px * var(--hab-u)), 0, 0); }
  to { transform: translate3d(calc(-128px * var(--hab-u)), 0, 0); }
}
@keyframes habMochilaB {
  from { transform: translate3d(calc(-32px * var(--hab-u)), 0, 0); }
  to { transform: translate3d(calc(-128px * var(--hab-u)), 0, 0); }
}

/* Globito de la ficha 3 y de retos en la 2. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-ficha-badge,
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .bso-reto-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  left: auto;
  bottom: auto;
  z-index: 4;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  box-sizing: border-box;
  font: 800 10px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-align: center;
  color: #fff;
  background: var(--power-accent, #ff2a3d);
  border: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 8px color-mix(in srgb, var(--power-accent, #ff2a3d) 70%, transparent);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-ficha-badge[hidden],
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .bso-reto-badge[hidden] { display: none; }

/* Slot 1 · contador digital integrado: pantalla de cristal bajo la moneda. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #hud-tokens-self .hab-spr { top: 1px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .power-console-coins-num {
  position: absolute;
  top: 28px;
  left: 4px;
  right: 4px;
  z-index: 2;
  display: block;
  height: 12px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;   /* un número recortado sería un saldo falso */
  padding: 0 1px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 3px;
  font: 900 9px/10px Orbitron, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  color: #a5f3fc;
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.85), 0 1px 0 rgba(0, 0, 0, 0.9);
  background: linear-gradient(180deg, rgba(6, 18, 24, 0.96), rgba(2, 8, 12, 0.98));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.05);
}
/* La meta de compra de perfil.js queda como un hilo de luz al pie de la pantalla. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .pw-meta-coins {
  top: 38px;
  bottom: auto;
  left: 7px;
  right: 7px;
  z-index: 3;
  height: 1px;
}

/* Slots 4 y 5 · ranura de cartucho: metal oscuro, apagadas y sin toques. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre { pointer-events: none; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre .hab-spr { top: 4px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre::before {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 46%),
    linear-gradient(180deg, #24262d 0%, #14151a 46%, #0a0b0f 100%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: rgba(148, 156, 172, 0.42);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.16),
    inset -1px -2px 0 rgba(0, 0, 0, 0.7),
    inset 0 -8px 12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 10px 18px -6px rgba(0, 0, 0, 0.75);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre .hud-slot-num { color: #71717a; text-shadow: none; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre .hud-slot-label { color: #8b8b95; text-shadow: none; }

/* ── Ventana de Inventario: consola RPG, cristal obsidiana con marco de latón ── */
.pf-inv-capa { position: fixed; inset: 0; z-index: 240; display: flex; align-items: flex-end; justify-content: center; }
.pf-inv-capa { touch-action: none; }
.pf-inv-capa[hidden] { display: none; }
.pf-inv-velo { position: absolute; inset: 0; background: rgba(3, 3, 8, 0.72); animation: pfInvVelo 180ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.pf-inv-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(600px, 100%);
  height: min(84dvh, 600px);
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(200, 170, 110, 0.62);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0, rgba(255, 255, 255, 0) 64px),
    radial-gradient(120% 50% at 50% 0, color-mix(in srgb, var(--power-accent, #ff2a3d) 12%, transparent) 0, transparent 70%),
    rgba(9, 9, 14, 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.34),
    inset 1px 0 0 rgba(255, 236, 190, 0.1),
    inset -1px 0 0 rgba(0, 0, 0, 0.6),
    0 -14px 36px rgba(0, 0, 0, 0.7),
    0 0 28px color-mix(in srgb, var(--power-accent, #ff2a3d) 14%, transparent);
  animation: pfInvSube 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Filete interior de latón: el segundo canto del marco. */
.pf-inv-panel::before {
  content: "";
  position: absolute;
  inset: 4px 4px 0;
  border: 1px solid rgba(200, 170, 110, 0.2);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}
.pf-inv-panel > * { position: relative; min-width: 0; }
.pf-inv-spr { display: block; flex: none; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; image-rendering: pixelated; }

.pf-inv-cab { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; padding-left: 4px; }
.pf-inv-tit { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; margin: 0; min-width: 0; font: 900 15px/1.2 Orbitron, Rajdhani, system-ui, sans-serif; letter-spacing: 0.06em; color: #fff; text-shadow: 0 1px 0 #000; }
.pf-inv-tit > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-inv-saldo {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 28px;
  margin: 0;
  padding: 0 9px 0 6px;
  border: 1px solid rgba(200, 170, 110, 0.42);
  border-radius: 8px;
  font: 800 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #fff4d6;
  background: linear-gradient(180deg, rgba(6, 7, 12, 0.96), rgba(16, 15, 18, 0.9));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 236, 190, 0.1);
}
.pf-inv-saldo b { font-weight: 800; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-x {
  flex: none;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  clip-path: none;
  border: 1px solid rgba(200, 170, 110, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%), rgba(13, 13, 18, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.18), inset 0 -2px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-x:active { transform: scale(0.95); }
.pf-inv-x-spr { display: block; width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.pf-inv-x:focus-visible { outline: 2px solid var(--power-accent, #ff2a3d); outline-offset: -2px; }

.pf-inv-capa .pf-inventario-cuerpo { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; margin: -4px; padding: 4px; overflow: hidden; }

/* Avisos del perfil propio: viven en body, flotan sobre la ventana y no empujan el dock (V-01). */
body > #vs-aviso {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 260;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 9px 14px;
  box-sizing: border-box;
  border: 1px solid rgba(200, 170, 110, 0.62);
  border-radius: 12px;
  font: 800 13px/1.3 Rajdhani, system-ui, sans-serif;
  text-align: center;
  color: #fde68a;
  background: rgba(11, 11, 17, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.22), 0 8px 22px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transform: translateX(-50%);
  animation: pfInvAviso 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pfInvAviso { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { body > #vs-aviso { animation: none; } }

/* Pestañas: el estado se pinta con aria-selected. */
.pf-inv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: none; min-width: 0; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 0 4px;
  clip-path: none;
  border: 1px solid rgba(200, 170, 110, 0.28);
  border-radius: 10px;
  color: #b4b4bd;
  font: 800 12px/1 Rajdhani, Orbitron, system-ui, sans-serif;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 60%), rgba(9, 9, 14, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.08), inset 0 -3px 6px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-tab:active { transform: scale(0.95); }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-tab[aria-selected="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--power-accent, #ff2a3d) 70%, rgba(200, 170, 110, 0.6));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--power-accent, #ff2a3d) 26%, transparent), transparent 80%),
    rgba(13, 12, 18, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.32),
    inset 0 -2px 0 var(--power-accent, #ff2a3d),
    0 0 12px color-mix(in srgb, var(--power-accent, #ff2a3d) 34%, transparent);
}
.pf-inv-tab:focus-visible { outline: 2px solid var(--power-accent, #ff2a3d); outline-offset: 2px; }
.pf-inv-tab-txt { min-width: 0; overflow: hidden; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-tab { position: relative; }
.pf-inv-tab-n {
  position: absolute;
  top: 3px;
  right: 3px;
  flex: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  box-sizing: border-box;
  font: 800 10px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  color: #fff;
  background: var(--power-accent, #ff2a3d);
}
.pf-inv-tab-n[hidden] { display: none; }

/* Cuadrícula de juego: casillas de 68 px, el nombre siempre visible debajo. Ocupa el alto que quede: la ventana no salta. */
.pf-inv-rejilla {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 68px);
  grid-auto-rows: max-content;
  gap: 8px 0;
  justify-content: space-between;
  align-content: start;
  padding: 10px 6px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 170, 110, 0.4) transparent;
  border: 1px solid rgba(200, 170, 110, 0.18);
  border-radius: 12px;
  background: rgba(3, 3, 7, 0.55);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 236, 190, 0.06);
}
.pf-inv-celda { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; width: 68px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-casilla {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-sizing: border-box;
  width: 68px;
  height: 68px;
  min-width: 0;
  margin: 0;
  padding: 0;
  clip-path: none;
  border: 1px solid rgba(200, 170, 110, 0.36);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.01) 34%, transparent 50%),
    radial-gradient(90% 70% at 50% 100%, rgba(200, 170, 110, 0.1), transparent 70%),
    rgba(10, 10, 15, 0.92);
  box-shadow:
    inset 1px 1px 0 rgba(255, 236, 190, 0.2),
    inset -1px -2px 0 rgba(0, 0, 0, 0.72),
    inset 0 -8px 12px rgba(0, 0, 0, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-casilla:active { transform: scale(0.95); }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-casilla[aria-pressed="true"] {
  border-color: var(--power-accent, #ff2a3d);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 34%, transparent 50%),
    radial-gradient(90% 80% at 50% 100%, color-mix(in srgb, var(--power-accent, #ff2a3d) 34%, transparent), transparent 75%),
    rgba(14, 12, 18, 0.95);
  box-shadow:
    inset 1px 1px 0 rgba(255, 236, 190, 0.28),
    inset -1px -2px 0 rgba(0, 0, 0, 0.72),
    0 0 0 1px color-mix(in srgb, var(--power-accent, #ff2a3d) 60%, transparent),
    0 0 14px color-mix(in srgb, var(--power-accent, #ff2a3d) 50%, transparent);
}
.pf-inv-casilla:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Hueco vacío: hundido, parte del inventario, sin toques. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-celda.is-vacia .pf-inv-casilla {
  border-color: rgba(200, 170, 110, 0.2);
  background: rgba(7, 7, 12, 0.78);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.72), 0 1px 0 rgba(255, 236, 190, 0.05);
  cursor: default;
}
.pf-inv-nombre {
  display: -webkit-box;
  width: 100%;
  min-height: 24px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font: 600 10.5px/12px Rajdhani, system-ui, sans-serif;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-align: center;
  color: #e4e4e7;
}
.pf-inv-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  box-sizing: border-box;
  border: 1px solid rgba(200, 170, 110, 0.5);
  border-radius: 4px;
  font: 800 10px/13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #fff;
  background: rgba(3, 3, 7, 0.92);
}
.pf-inv-badge[data-cero] { color: #8b8b95; border-color: rgba(200, 170, 110, 0.2); }
.pf-inv-casilla > img { display: block; pointer-events: none; }
.pf-inv-mono { font: 900 22px/1 Orbitron, system-ui, sans-serif; color: #e4e4e7; text-shadow: 0 2px 0 #000; }

/* Barra de detalle: fija, misma altura en las tres pestañas. */
.pf-inv-detalle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  box-sizing: border-box;
  height: 72px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(200, 170, 110, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%),
    rgba(12, 12, 18, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.22), inset 0 -3px 8px rgba(0, 0, 0, 0.55);
}
.pf-inv-det-arte { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; }
.pf-inv-det-arte:empty { display: none; }
.pf-inv-det-txt { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.pf-inv-det-nom { overflow: hidden; font: 800 14px/1.15 Rajdhani, system-ui, sans-serif; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.pf-inv-det-sub { overflow: hidden; font: 600 12px/1.2 Rajdhani, system-ui, sans-serif; color: #c9c9d1; text-overflow: ellipsis; white-space: nowrap; }
.pf-inv-det-sub:empty { display: none; }
.pf-inv-det-acc { display: flex; flex: none; min-width: 0; }
.pf-inv-det-acc:empty { display: none; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-accion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 88px;
  min-height: 48px;
  margin: 0;
  padding: 3px 10px;
  clip-path: none;
  border: 1px solid color-mix(in srgb, var(--power-accent, #ff2a3d) 72%, rgba(255, 236, 190, 0.5));
  border-radius: 10px;
  color: #fff;
  font: 800 13px/1.1 Rajdhani, Orbitron, system-ui, sans-serif;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 50%),
    color-mix(in srgb, var(--power-accent, #ff2a3d) 62%, #120a0f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -3px 0 rgba(0, 0, 0, 0.36),
    0 0 12px color-mix(in srgb, var(--power-accent, #ff2a3d) 40%, transparent);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-accion:active { transform: scale(0.95); }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-inv-capa .pf-inv-accion:disabled {
  border-color: rgba(200, 170, 110, 0.24);
  color: #8b8b95;
  background: rgba(16, 16, 22, 0.92);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.pf-inv-accion:disabled .pf-inv-spr { opacity: 0.55; }
.pf-inv-accion:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pf-inv-precio { display: flex; align-items: center; gap: 3px; font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

@media (min-width: 520px) {
  .pf-inv-rejilla { grid-template-columns: repeat(6, 68px); padding: 10px 12px; }
}
@keyframes pfInvVelo {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pfInvSube {
  from { transform: translate3d(0, 28px, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

/* ── Tablet y escritorio: las fichas siguen midiendo lo que la de arriba (106×116 y 140×154) y la barra
      sale del relleno del panel para quedar con su mismo ancho. Sprites y placa a ×2. ── */
@media (min-width: 640px) {
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock { --hab-u: 2; width: calc(100% + 2 * 0.65rem + 2px); margin: 0.35rem calc(-0.65rem - 1px) 0; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha { min-height: 76px; aspect-ratio: 1 / 1.1; }
  .hab-placa { --hab-p: 2px; top: 4px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha .hab-spr { top: 12px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #hud-tokens-self .hab-spr { top: 8px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .power-console-coins-num { top: 66px; left: 12px; right: 12px; height: 18px; font-size: 13px; line-height: 16px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .pw-meta-coins { top: 83px; left: 15px; right: 15px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre .hab-spr { top: 18px; }
  .pf-inv-capa { align-items: center; }
  .pf-inv-panel { border-bottom: 1px solid rgba(200, 170, 110, 0.62); border-radius: 20px; padding-bottom: 14px; }
  .pf-inv-panel::before { inset: 4px; border-bottom: 1px solid rgba(200, 170, 110, 0.2); border-radius: 16px; }
}
@media (min-width: 1024px) {
  .hab-placa { top: 12px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha .hab-spr { top: 20px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > #hud-tokens-self .hab-spr { top: 16px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .power-console-coins-num { top: 76px; left: 26px; right: 26px; height: 20px; font-size: 14px; line-height: 18px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .pw-meta-coins { top: 95px; left: 29px; right: 29px; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha-libre .hab-spr { top: 32px; }
}

/* ── Speed dial de la tuerca (v540 Dirección · v541 universal, §7.286 y §7.287) ─────────────────────────────────
   Perfil propio (html[data-pf-cmd="propio"]), decidido en el <head> antes del primer pintado. Dirección
   (html[data-pf-dop="1"]: Director REAL fuera de un Doppelgänger) ve 5 botones desde la tuerca: Ajustes, tutorial,
   Auditor, Doppelgänger y Roles (v542, §7.288). El resto ve los 2 primeros: Ajustes y tutorial (los demás llevan
   .pf-dial-dir), así el escalonado por nth-child sirve para los dos. Superpuesto a la tarjeta: abrirlo o cerrarlo no
   mueve ninguna caja (V-01). Solo transform y opacity (§6.1). */
#pf-dial { display: none; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero #pf-dial {
  position: absolute; z-index: 39; top: 2px; right: 56px;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
  padding: 6px; border-radius: 999px;
  background: rgba(13, 13, 18, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(217, 164, 65, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(196, 160, 82, 0.16), 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(245, 158, 11, 0.16);
  transform-origin: right center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(12px) scaleX(0.4);
  transition-property: opacity, transform, visibility;
  transition-duration: 160ms, 280ms, 0s;
  transition-delay: 0s, 0s, 280ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1), cubic-bezier(0.34, 1.56, 0.64, 1), cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero #pf-dial[data-abierto="1"] {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s, 0s, 0s;
}
/* Botón del dial: chasis circular de 48 px, cristal oscuro, aro de oro y glifo dorado, el lenguaje de la tuerca. */
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > .pf-dial-btn {
  position: relative; flex: 0 0 auto; box-sizing: border-box;
  width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.12), transparent 62%), rgba(9, 9, 13, 0.94);
  border: 1.5px solid rgba(217, 164, 65, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.55), 0 3px 8px rgba(0, 0, 0, 0.5);
  color: #fcd34d; font-size: 17px; line-height: 1;
  cursor: pointer; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  opacity: 0; transform: scale(0.6);
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 160ms cubic-bezier(0.16, 1, 0.3, 1), filter 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > .pf-dial-btn.hidden { display: none; }
/* Auditor, Doppelgänger y Roles: solo Dirección. Va después de la regla del botón, con una clase más. */
html[data-pf-cmd="propio"]:not([data-pf-dop="1"]):not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > .pf-dial-btn.pf-dial-dir { display: none; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn { opacity: 1; transform: none; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:nth-child(2) { transition-delay: 40ms; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:nth-child(3) { transition-delay: 80ms; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:nth-child(4) { transition-delay: 120ms; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:nth-child(5) { transition-delay: 160ms; }
/* v542 · Con 5 botones (284 px) el dial de Dirección se salía de la tarjeta a 360 px (ficha v540: nada desbordado sobre
   el fondo). Bajo 380 px se aprietan la separación y el relleno; los botones siguen en 48 px. */
@media (max-width: 379px) {
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero #pf-dial { gap: 4px; padding: 4px; right: 54px; top: 4px; }
}
/* v542 · Modo Auditor activo (aria-checked, lo escribe wireDialAuditor): aro y glifo cian sobre el mismo chasis. */
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > #btn-pf-dial-auditor[aria-checked="true"] {
  border-color: rgba(34, 211, 238, 0.95); color: #67e8f9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(34, 211, 238, 0.45), 0 0 14px rgba(34, 211, 238, 0.55);
}
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:hover { filter: brightness(1.2); }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial[data-abierto="1"] > .pf-dial-btn:active { transform: scale(0.92); transition-delay: 0s; }
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > .pf-dial-btn:focus-visible { outline: 2px solid #fde68a; outline-offset: 2px; }
/* La tuerca abierta gira y brilla en oro. */
html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #btn-open-settings[aria-expanded="true"] {
  transform: rotate(90deg); border-color: rgba(253, 230, 138, 0.95) !important; color: #fde68a !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.55), 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}
/* Tuerca: 36 px a la vista, 48 px de área táctil. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-settings-gear::after { content: ""; position: absolute; inset: -6px; border-radius: 999px; }

/* ── v541 · Grabado de la tarjeta (§7.287): rótulo en bajorrelieve sobre el material, esquina superior izquierda.
   Monoespaciada de 9 px, gris azulado tenue; sombra oscura arriba y luz abajo, como un corte en el cristal. Sin borde
   ni fondo: no compite con el avatar ni con la tuerca. Posición absoluta: el texto puede cambiar sin mover nada. */
/* A-003 · con el chip CHARGING SPOT en la tarjeta (hábitat v3 y perfil propio) el grabado baja debajo: top 10 + alto 18 + 6 = 34 px. */
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero > #perfil-sub.pf-grabado { top: 34px; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero > #perfil-sub.pf-grabado {
  position: absolute; z-index: 15; top: 14px; left: 16px;
  max-width: calc(50% - 64px); overflow: hidden; white-space: pre-line;   /* «CHARGING SPOT» / «// PERFIL»: dos líneas, ninguna se corta */
  margin: 0; padding: 0; border: 0;
  /* Las skins (bubblegum, cotton, matcha, street) pintaban la píldora vieja con !important: el grabado no lleva placa. */
  background: none !important; box-shadow: none !important;
  font-family: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;
  font-size: 9px; font-weight: 700; line-height: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8892b0; opacity: 0.45;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.22);
  pointer-events: none; user-select: none;
}

/* La cabecera ya no lleva sello ni tutorial: solo recibe el aviso de perfil parcial. Sin él no ocupa lugar. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-head-meta:not(:has(#pf-respaldo)) { display: none; }

/* ── v541 · Scroll del perfil estable (§7.287). Sin anclaje de scroll en ningún ancho: los bloques que llegan tarde
   (asistencias, hábitat, compañeros) no corrigen la posición del dedo ni rebotan al volver arriba. main.perfil-page
   va en su propia capa de GPU. Ojo: will-change: transform vuelve a main bloque contenedor de todo hijo position: fixed.
   La pantalla completa del hábitat (#power-companion-box fijo, dentro de main) quedaría pegada a main y no a la
   pantalla: con body.pet-fullscreen-lock (perfil.js) la capa se apaga. Los modales viven fuera de main. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d), html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body, html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page { overflow-anchor: none !important; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body:not(.pet-fullscreen-lock) main.perfil-page { will-change: transform; }
/* HOTFIX_HEADER_INICIO · Pantalla completa SIN Fullscreen API (iPhone: la caja es position: fixed, z-index 999999, fuera de la capa superior).
 * main.perfil-page (position: relative + z-index: 1, power-ui.css:6273) y #hud-panels-area (z-index: 1) son contexto de apilamiento: la caja
 * (fixed, z-index 999999) queda atrapada en el nivel 1 y el encabezado (.power-console-header, sticky, z-index 100), el buscador y
 * Asistencias se pintan ENCIMA. Medido con elementFromPoint en iPhone sin Fullscreen API. Solo con body.pet-fullscreen-lock. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body.pet-fullscreen-lock main.perfil-page { z-index: auto !important; }
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body.pet-fullscreen-lock #hud-panels-area { z-index: auto !important; }
/* Skins con recorte o cristal en .pf-section (Cyber Pulse power-skins.css:369-378, Cobalto perfil.html:4805-4807, reactor/frost/pulse backdrop-filter en power-skins.css:494,1776,3103 y power-energy.css:189) o el blur propio (perfil.html:1536): la sección es ANCESTRO de la caja; clip-path y backdrop-filter crean contexto y bloque contenedor del fixed y recortan la caja. La sección queda tapada por la caja, no se nota. */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body.pet-fullscreen-lock #personalizacion-hotbar-section { clip-path: none !important; -webkit-clip-path: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
/* Lo que se monta en <body> y se abre desde DENTRO de la caja (Luces del Studio luces-studio.css:9 z 9000; #pf-toast-tactico perfil.html:5374 z 100000) tiene que quedar sobre la caja (999999) y el ✕ SALIR (1000000). */
html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body.pet-fullscreen-lock :is(#pet-luces, #pf-toast-tactico) { z-index: 1000001 !important; }
/* HOTFIX_HEADER_FIN */

/* v541 · Hueco de Asistencias reservado desde el <head> (data-pf-asis): la tarjeta de perfil-r188.js se llena en su lugar. */
#pf-asis-r188:empty { display: none; }
html[data-pf-asis="1"] #pf-asis-r188 { display: block; min-height: 114px; }

@media (prefers-reduced-motion: reduce) {
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-hero #pf-dial,
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-dial > .pf-dial-btn { transition-duration: 0s; transition-delay: 0s; }
}

/* ── Teléfono: la identidad encabeza, en todo rol y vista (Dirección, §7.282).
   Navegación → tarjeta → cabecera → buscador → hotbar → lienzo → dock. La cabecera no tiene fila visible en ningún
   rol: el sello va grabado en la tarjeta y los accesos en el dial de la tuerca (v541). El error, por encima de todo, para que se lea. ── */
@media (max-width: 639px) {
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page { display: flex; flex-direction: column; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > * { min-width: 0; }
  /* Con order, el primer bloque del HTML no es el primero en pantalla. Chrome restauraba el scroll por ese ancla: al
     recargar con otra identidad, la página arrancaba corrida 224 px. Desde v541 overflow-anchor: none rige en todo ancho (arriba). */
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > #perfil-error { order: -4; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > section.pf-hero { order: -2; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > .pf-head,
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > #pf-search-wrap { order: -1; }
  /* Perfil propio: la fila de insignias tiene su caja desde el primer pintado. La tarjeta va arriba: si creciera al llegar el rol, empujaría toda la página (V-01). */
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-id-tags { min-height: 41px; box-sizing: border-box; }
  /* Visita: sin Power ID ni insignia. Con la caja final desde el primer pintado, la tarjeta no encoge ni arrastra lo de abajo. */
  html[data-pf-cmd="ajeno"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-id { display: none; }
  html[data-pf-cmd="ajeno"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #pf-id-tags { min-height: 28px; box-sizing: border-box; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > .pf-head { margin-bottom: 0; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-head-titulo > p { display: none; }
  /* El título sigue para lectores de pantalla: la pestaña PERFIL ya dice dónde estás. */
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-head-titulo > h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .pf-head { gap: 0; }
  /* v541 · En todo rol la cabecera queda vacía en teléfono (título solo para lectores; sello grabado en la tarjeta;
     accesos en el dial). No ocupa fila; si llega el aviso de perfil parcial, la fila vuelve para mostrarlo. */
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body main.perfil-page > #personalizacion-hotbar-section { padding: 0.35rem !important; margin-bottom: 0.6rem !important; }
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #personalizacion-hotbar-section > .pf-section-head { display: none; }

  /* Hotbar superior: de 68 a 54 px, con la misma separación que el dock. */
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #personalizacion-hotbar-section > .hud-hotbar { gap: 0.3rem; padding: 0.3rem; margin-bottom: 0; }
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #personalizacion-hotbar-section > .hud-hotbar .hud-slot { min-height: 54px; height: 54px; aspect-ratio: auto; }

  /* Sin aire de sobra entre las barras y el lienzo. */
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #hud-panels-area { margin: 0.25rem 0 0; padding: 0; min-height: 0; }
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #hud-panels-area > #hud-panel-companero { padding: 0; background: none; border: 0; box-shadow: none; }
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body #hud-panel-companero .hud-panel-inner { padding: 0; gap: 0; }
  html[data-pf-cmd="propio"]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock { gap: 0.3rem; padding: 0.3rem; margin-top: 0.25rem; }
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha { min-height: 54px; height: 54px; }
}

/* ── Movimiento reducido: moneda y gabinete quietos en su primer cuadro; la barra sin barrido. ── */
@media (prefers-reduced-motion: reduce) {
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock::after { animation: none; opacity: 0; }
  .hab-spr-moneda::before,
  .hab-spr-arcade::before,
  #btn-inventario[data-pulso] .hab-spr-mochila::before { animation: none; }
  .pf-inv-velo,
  .pf-inv-panel { animation: none; }
}
/* Con el modal de skins abierto, el dock se pausa como la hotbar. */
html[data-pa-skins-modal] .hab-spr::before,
html[data-pa-skins-modal] .power-console-dock.hab-dock::after { animation-play-state: paused !important; }
/* Teléfono angosto: un poco más de lugar; lo que no entre termina en puntos suspensivos. */
@media (max-width: 340px) {
  html:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .power-console-coins-num { left: 2px; right: 2px; padding: 0; font-size: 8px; }
}
/* ══ HÁBITAT v3 (H1) · el dock con las 5 fichas vivas (solo con html[data-habitat-v3], interruptor APAGADO por defecto) ══
 * Lámina 02 v3.1 y prototipo_barras_v3.html: POWER COINS (⚡ en la píldora) · ARCADE · MOCHILA · CUIDAR · PULPERÍA. El chasis
 * (.hab-ficha::before) no cambia: hotbar-viva.js pinta cada ícono en su lienzo y acá se apaga el sprite plano de hoy.
 * Las 2 ranuras LIBRE pasan a ser botones (habitat-v3.js) con la misma caja de 54–68 px. La barra deja de recortar para que
 * la píldora y el globito asomen por el filo; su barrido pasa a .hv3-barrido (perfil-fashion.css), que sí recorta. */
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock { overflow: visible; }
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .power-console-dock.hab-dock::after { content: none; }
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > [data-ficha="cuidar"] { grid-column: 4; --hab-fuga: -59%; }
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > [data-ficha="pulperia"] { grid-column: 5; --hab-fuga: -168%; }
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock > .hab-ficha[data-ficha] :is(.hab-spr, .hab-placa, .power-console-coins-num, .pw-meta-coins) { display: none; }
/* Píldora del saldo (prototipo `.cuenta`): colores de la marca, el rayo siempre encendido. */
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-cuenta {
  position: absolute; right: -5px; top: -7px; z-index: 3; padding: 1px 5px 1px 4px; border-radius: 8px; background: #15141c;
  border: 1px solid #ff2a4a; box-shadow: 0 0 0 2px #0f0e14, 0 0 10px rgba(255, 42, 74, .6);
  font: 800 9px/14px 'Orbitron', monospace; letter-spacing: 0; color: #fff1f3; white-space: nowrap; pointer-events: none;
}
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-cuenta i { font-style: normal; color: #ff2a4a; margin-right: 1px; }
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-cuenta b { font-weight: inherit; }
/* Globito de MOCHILA (prototipo `.badge`). */
html[data-habitat-v3]:not(#hd-a):not(#hd-b):not(#hd-c):not(#hd-d) body .hab-dock .hab-ficha-badge {
  right: -4px; top: -6px; min-width: 18px; height: 18px; padding: 0; border-radius: 9px; background: #ff2a4a; color: #fff;
  font: 800 10px/18px 'Orbitron', monospace; text-align: center; box-shadow: 0 0 0 2px #0f0e14, 0 0 10px rgba(255, 42, 74, .7);
}
/* ══ HÁBITAT v3 (H3) · ARCO DE CUIDAR, bandeja de COMER y TRUCOS y la noche (solo con html[data-habitat-v3]) ══
 * Lámina 05 de rediseno-v2 y tools/habitat_ref/proto/estilos.css (.radial .rb · .bandeja · .com · .vacio · .btn.pri · .trucos
 * .truco · .noche · .mini · .flota), valores literales. El mini-menú de siempre (deco-tienda.css) sigue para la pócima y la venta
 * («pulperia»). La bandeja (#hv3-bandeja, companion 18) va en el lugar del dock mientras está abierta. */
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] { pointer-events: none; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-caja {
  display: block; position: relative; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; animation: none;
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-rb {
  position: absolute; width: 58px; min-width: 58px; height: 58px; min-height: 58px; padding: 0; gap: 0; border-radius: 50%;
  pointer-events: auto; display: grid; place-items: center; color: #f4f4f6;
  background: radial-gradient(circle at 50% 35%, #24242e, #0d0d12); border: 1.5px solid rgba(255, 255, 255, .14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: hv3Rb .42s cubic-bezier(.34, 1.56, .64, 1) backwards;
  transition: transform 120ms cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-rb:hover { filter: none; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-rb:focus-visible { filter: none; outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-rb img { width: 40px; height: 40px; image-rendering: pixelated; pointer-events: none; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-rb .ptm-txt {
  position: absolute; top: 60px; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap;
  font: 800 8px/1.2 'Orbitron', sans-serif; letter-spacing: .14em; color: #f4f4f6;
  background: rgba(0, 0, 0, .75); padding: 2px 6px; border-radius: 5px;
}
@keyframes hv3Rb { from { transform: translate(var(--ox), var(--oy)) scale(.2); opacity: 0; } }
/* t-perfil-rapidos · «GUARDAR EN LA CÁPSULA» / «SACAR DE LA CÁPSULA» (companion 37 · hv3BtnCapsula): píldora de cristal obsidiana
 * con bisel latón bajo las patas, 44 px de alto (área táctil en la regla base), HD (sin pixel). Entra con la curva oficial. */
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap {
  position: absolute; width: auto; min-width: 150px; max-width: calc(100% - 8px); height: 44px; min-height: 44px; padding: 0 14px 0 10px;
  pointer-events: auto; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; border-radius: 22px;
  color: #f4f4f6; background: linear-gradient(180deg, rgba(36, 36, 46, .92), rgba(13, 13, 18, .92));
  border: 1px solid rgba(214, 178, 106, .55);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 236, 196, .18), inset 0 -1px 0 rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: hv3Cap .42s cubic-bezier(.34, 1.56, .64, 1) 150ms backwards;
  transition: transform 120ms cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap:hover { filter: none; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap:active { transform: scale(.96); }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap:focus-visible { filter: none; outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-cap .ptm-txt {
  max-width: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 9px/1.2 'Orbitron', sans-serif; letter-spacing: .12em; color: #f4f4f6;
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-cap-ico {
  flex: 0 0 14px; width: 14px; height: 20px; border-radius: 7px; min-width: 0;
  background: linear-gradient(180deg, #ff4a62 0 48%, #1a1a22 48% 52%, #f1f1f5 52% 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 6px rgba(255, 42, 74, .45);
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-cap[data-cap="dentro"] .ptm-cap-ico { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 8px rgba(255, 210, 120, .7); }
@keyframes hv3Cap { from { transform: translateY(10px) scale(.6); opacity: 0; } }

/* La bandeja va entre el cuarto y el dock (prototipo app.js: cuarto · bandeja · dock); el dock sigue a la vista. */
html[data-habitat-v3] .hv3-bandeja {
  min-width: 0; margin-top: .25rem; border-radius: 18px; background: #0e0e13; border: 1px solid rgba(255, 255, 255, .14); padding: 10px;
  display: flex; flex-direction: column; gap: 8px; color: #f4f4f6; font-family: 'Rajdhani', sans-serif; letter-spacing: 0; line-height: normal; -webkit-font-smoothing: antialiased;
}
html[data-habitat-v3] .hv3-bandeja[hidden] { display: none; }
html[data-habitat-v3] .hv3-bandeja[data-abierto="a"] { animation: hv3SubeA .38s cubic-bezier(.16, 1, .3, 1); }
html[data-habitat-v3] .hv3-bandeja[data-abierto="b"] { animation: hv3SubeB .38s cubic-bezier(.16, 1, .3, 1); }
@keyframes hv3SubeA { from { transform: translateY(16px); opacity: 0; } }
@keyframes hv3SubeB { from { transform: translateY(16px); opacity: 0; } }
html[data-habitat-v3] .hv3-bandeja button {
  font: inherit; color: inherit; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; min-width: 0;
}
html[data-habitat-v3] .hv3-bandeja button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv3-bandeja img { image-rendering: pixelated; pointer-events: none; }
html[data-habitat-v3] .hv3-bt { display: flex; align-items: center; gap: 8px; font: 800 10px/1.2 'Orbitron', sans-serif; letter-spacing: .14em; min-width: 0; }
html[data-habitat-v3] .hv3-bt img { flex: 0 0 28px; }
html[data-habitat-v3] .hv3-bt small { margin-left: auto; font: 600 12px/1.2 'Rajdhani', sans-serif; letter-spacing: 0; color: #6b7080; white-space: nowrap; }
html[data-habitat-v3] .hv3-fila-com { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; min-width: 0; }
html[data-habitat-v3] .hv3-fila-com::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv3-bandeja .hv3-com {
  flex: 0 0 74px; height: 92px; border-radius: 14px; position: relative; display: flex; flex-direction: column; align-items: center; padding: 4px 0 0;
  background: linear-gradient(180deg, #191921, #0e0e13); border: 1px solid var(--rc, rgba(255, 255, 255, .14));
  transition: transform 120ms cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv3-bandeja .hv3-com:active { transform: scale(.95); }
html[data-habitat-v3] .hv3-com img { width: 48px; height: 48px; }
html[data-habitat-v3] .hv3-com .n { font-size: 11px; font-weight: 700; line-height: 1.05; text-align: center; padding: 0 4px; }
html[data-habitat-v3] .hv3-com .e { position: absolute; bottom: 4px; font: 800 8.5px/1.2 'Orbitron', sans-serif; color: #7CFFB2; }
html[data-habitat-v3] .hv3-com .x { position: absolute; top: 3px; right: 5px; font: 900 10px/1.2 'Orbitron', sans-serif; }
html[data-habitat-v3] .hv3-vacio { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: #0b0b10; border: 1px dashed rgba(255, 255, 255, .14); }
html[data-habitat-v3] .hv3-vacio img { width: 48px; height: 48px; flex: 0 0 48px; opacity: .5; filter: grayscale(1); }
html[data-habitat-v3] .hv3-vacio p { margin: 0; font-size: 13px; color: #a9adbd; line-height: 1.2; flex: 1; min-width: 0; }
html[data-habitat-v3] .hv3-vacio b { color: #fff; }
html[data-habitat-v3] .hv3-bandeja .hv3-btn-pri {
  height: 44px; padding: 0 16px; border: 0; border-radius: 12px; font: 800 10px/1 'Orbitron', sans-serif; letter-spacing: .14em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #fff;
  background: linear-gradient(180deg, #ff3b4f, #c81e30); box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
html[data-habitat-v3] .hv3-btn-pri img { width: 24px; height: 24px; }
html[data-habitat-v3] .hv3-trucos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html[data-habitat-v3] .hv3-bandeja .hv3-truco {
  border-radius: 16px; padding: 10px; background: #101016; border: 1px solid rgba(255, 255, 255, .14); display: flex; gap: 8px; align-items: center;
  min-height: 64px; text-align: left;
}
html[data-habitat-v3] .hv3-truco img { width: 40px; height: 40px; flex: 0 0 40px; }
html[data-habitat-v3] .hv3-truco > span { min-width: 0; }
html[data-habitat-v3] .hv3-truco b { display: block; font-size: 14px; line-height: 1.05; }
html[data-habitat-v3] .hv3-truco small { font: 700 8px/1.2 'Orbitron', sans-serif; letter-spacing: .12em; color: #6b7080; }
html[data-habitat-v3] .hv3-bandeja .hv3-truco[data-bloqueado="1"] { opacity: .5; cursor: not-allowed; }

/* Las skins tiñen todo `.pf-section button` con !important (power-skins.css, «Interactivos por identidad»): el arco y la
 * bandeja conservan el arte de la lámina 05 (mayor especificidad + !important; las skins no se tocan). */
html[data-habitat-v3] body #power-companion-box #pet-tama-menu[data-arco] button.ptm-cap {
  background: linear-gradient(180deg, rgba(36, 36, 46, .92), rgba(13, 13, 18, .92)) !important; border-color: rgba(214, 178, 106, .55) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 236, 196, .18), inset 0 -1px 0 rgba(0, 0, 0, .5) !important;
}
html[data-habitat-v3] body #power-companion-box #pet-tama-menu[data-arco] button.ptm-rb {
  background: radial-gradient(circle at 50% 35%, #24242e, #0d0d12) !important; border-color: rgba(255, 255, 255, .14) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1) !important;
}
html[data-habitat-v3] body .hv3-bandeja button.hv3-com {
  background: linear-gradient(180deg, #191921, #0e0e13) !important; border-color: var(--rc, rgba(255, 255, 255, .14)) !important; box-shadow: none !important;
  font-family: 'Rajdhani', sans-serif !important;
}
html[data-habitat-v3] body .hv3-bandeja button.hv3-truco {
  background: #101016 !important; border-color: rgba(255, 255, 255, .14) !important; box-shadow: none !important; font-family: 'Rajdhani', sans-serif !important;
}
html[data-habitat-v3] body .hv3-bandeja button.hv3-btn-pri {
  background: linear-gradient(180deg, #ff3b4f, #c81e30) !important; border-color: transparent !important;
  box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25) !important; font-family: 'Orbitron', sans-serif !important;
}

/* DORMIR: las luces bajan (velo azul al 82 %) y la recarga se ve (prototipo .noche y .hud .mini). */
html[data-habitat-v3] #power-companion-box > .hv3-noche {
  position: absolute; inset: 0; z-index: 36; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 24, 60, .35), rgba(4, 6, 20, .82));
  transition: opacity .8s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] #power-companion-box > .hv3-noche[data-on="1"] { opacity: 1; }
html[data-habitat-v3] #power-companion-box > .hv3-hud { position: absolute; left: 10px; top: 10px; z-index: 37; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
html[data-habitat-v3] #power-companion-box > .hv3-hud[hidden] { display: none; }
/* t-dialogos-mascota · CUIDAR abierto muestra VIDA y ENERGÍA de una; «RECARGANDO» es solo de dormir. */
html[data-habitat-v3] #power-companion-box > .hv3-hud[data-cuidar] .hv3-recarga { display: none; }
/* El cuarto de la app tiene el botón de pantalla completa arriba a la izquierda (13–59 px), que la lámina no muestra: el HUD
 * se corre a su derecha para no taparlo (desvío declarado en el progreso). */
html[data-habitat-v3] #power-companion-box:has(#pet-fullscreen-btn:not([hidden])) > .hv3-hud { left: 66px; }
html[data-habitat-v3] .hv3-mini {
  display: flex; align-items: center; gap: 6px; font: 700 8px/1.2 'Orbitron', sans-serif; letter-spacing: .1em; color: #fff;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
html[data-habitat-v3] .hv3-mini i { display: block; width: 54px; height: 5px; border-radius: 3px; background: #2a2a32; overflow: hidden; }
html[data-habitat-v3] .hv3-mini i b { display: block; width: 100%; height: 100%; border-radius: 3px; transform-origin: 0 50%; }
html[data-habitat-v3] .hv3-mini .hv3-vida { background: #4ade80; }
html[data-habitat-v3] .hv3-mini .hv3-energia { background: #fbbf24; }
html[data-habitat-v3] .hv3-mini em { font-style: normal; }
html[data-habitat-v3] .hv3-mini.hv3-recarga { color: #b9c4ff; }
/* «+N ⚡ ¡ñam!» (prototipo .flota). */
html[data-habitat-v3] #power-companion-box > .hv3-flota {
  position: absolute; z-index: 41; pointer-events: none; white-space: nowrap; font: 900 13px/1.2 'Orbitron', sans-serif; color: #7CFFB2;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .8); animation: hv3Flota 1.2s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes hv3Flota {
  0% { transform: translate(-50%, 0) scale(.6); opacity: 0; }
  25% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -38px) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-rb,
  html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap,
  html[data-habitat-v3] .hv3-bandeja[data-abierto] { animation: none; }
  html[data-habitat-v3] #power-companion-box > .hv3-noche { transition: none; }
  html[data-habitat-v3] #power-companion-box > .hv3-flota { animation-duration: 1ms; }
  html[data-habitat-v3] #power-companion-box > .hv3-latido,
  html[data-habitat-v3] .hv3-bandeja .hv3-com[data-pendiente] img,
  html[data-habitat-v3] .hv3-bandeja .hv3-com[data-revertida] { animation-duration: 1ms; }
}
/* ══ t-energia · ENERGÍA ≠ POWER COINS ══════════════════════════════════════════════════════════════════════════════════════
 * La energía de la mascota es una GOTA ÁMBAR en pixel art (8 × 10, escala entera ×1 / ×2): el líquido de la familia CUIDAR de
 * iconos-v4 (cuidar_simulacion_80_30_10: el líquido es la vida) y el ámbar #fbbf24 de la barra ENERGÍA de la lámina 05. La ⚡
 * queda solo para las Power Coins. Corazón pixel (9 × 8, rojo de marca, ×2) = respuesta al toque de COMER mientras el servidor
 * confirma (fuentes 37 y 44). Solo transform y opacity; curvas oficiales. */
html[data-habitat-v3] .hv3-en {
  display: inline-block; flex: 0 0 auto; width: 8px; height: 10px; margin: 0 1px 0 2px; vertical-align: -1px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10' shape-rendering='crispEdges'><rect x='3' y='0' width='2' height='1' fill='%23422a06'/><rect x='2' y='1' width='1' height='1' fill='%23422a06'/><rect x='3' y='1' width='2' height='1' fill='%23fbbf24'/><rect x='5' y='1' width='1' height='1' fill='%23422a06'/><rect x='2' y='2' width='1' height='1' fill='%23422a06'/><rect x='3' y='2' width='2' height='1' fill='%23fbbf24'/><rect x='5' y='2' width='1' height='1' fill='%23422a06'/><rect x='1' y='3' width='1' height='1' fill='%23422a06'/><rect x='2' y='3' width='4' height='1' fill='%23fbbf24'/><rect x='6' y='3' width='1' height='1' fill='%23422a06'/><rect x='1' y='4' width='1' height='1' fill='%23422a06'/><rect x='2' y='4' width='1' height='1' fill='%23fff3c4'/><rect x='3' y='4' width='3' height='1' fill='%23fbbf24'/><rect x='6' y='4' width='1' height='1' fill='%23422a06'/><rect x='0' y='5' width='1' height='1' fill='%23422a06'/><rect x='1' y='5' width='1' height='1' fill='%23fbbf24'/><rect x='2' y='5' width='1' height='1' fill='%23fff3c4'/><rect x='3' y='5' width='4' height='1' fill='%23fbbf24'/><rect x='7' y='5' width='1' height='1' fill='%23422a06'/><rect x='0' y='6' width='1' height='1' fill='%23422a06'/><rect x='1' y='6' width='1' height='1' fill='%23fbbf24'/><rect x='2' y='6' width='1' height='1' fill='%23fff3c4'/><rect x='3' y='6' width='3' height='1' fill='%23fbbf24'/><rect x='6' y='6' width='1' height='1' fill='%23d97706'/><rect x='7' y='6' width='1' height='1' fill='%23422a06'/><rect x='0' y='7' width='1' height='1' fill='%23422a06'/><rect x='1' y='7' width='4' height='1' fill='%23fbbf24'/><rect x='5' y='7' width='2' height='1' fill='%23d97706'/><rect x='7' y='7' width='1' height='1' fill='%23422a06'/><rect x='1' y='8' width='1' height='1' fill='%23422a06'/><rect x='2' y='8' width='1' height='1' fill='%23fbbf24'/><rect x='3' y='8' width='3' height='1' fill='%23d97706'/><rect x='6' y='8' width='1' height='1' fill='%23422a06'/><rect x='2' y='9' width='4' height='1' fill='%23422a06'/></svg>") 0 0 / 100% 100% no-repeat; image-rendering: crisp-edges; image-rendering: pixelated;
}
html[data-habitat-v3] .hv3-mini .hv3-en { margin: 0 -2px 0 0; }
html[data-habitat-v3] #power-companion-box > .hv3-flota .hv3-en { width: 16px; height: 20px; margin: 0 2px 0 3px; vertical-align: -4px; }
html[data-habitat-v3] #power-companion-box > .hv3-latido {
  position: absolute; z-index: 41; width: 18px; height: 16px; margin-left: -9px; pointer-events: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 8' shape-rendering='crispEdges'><rect x='1' y='0' width='2' height='1' fill='%23300810'/><rect x='6' y='0' width='2' height='1' fill='%23300810'/><rect x='0' y='1' width='1' height='1' fill='%23300810'/><rect x='1' y='1' width='2' height='1' fill='%23ff2a4a'/><rect x='3' y='1' width='1' height='1' fill='%23300810'/><rect x='5' y='1' width='1' height='1' fill='%23300810'/><rect x='6' y='1' width='2' height='1' fill='%23ff2a4a'/><rect x='8' y='1' width='1' height='1' fill='%23300810'/><rect x='0' y='2' width='1' height='1' fill='%23300810'/><rect x='1' y='2' width='1' height='1' fill='%23ff2a4a'/><rect x='2' y='2' width='1' height='1' fill='%23ffc2cc'/><rect x='3' y='2' width='1' height='1' fill='%23ff2a4a'/><rect x='4' y='2' width='1' height='1' fill='%23300810'/><rect x='5' y='2' width='3' height='1' fill='%23ff2a4a'/><rect x='8' y='2' width='1' height='1' fill='%23300810'/><rect x='0' y='3' width='1' height='1' fill='%23300810'/><rect x='1' y='3' width='1' height='1' fill='%23ff2a4a'/><rect x='2' y='3' width='1' height='1' fill='%23ffc2cc'/><rect x='3' y='3' width='4' height='1' fill='%23ff2a4a'/><rect x='7' y='3' width='1' height='1' fill='%23b3122c'/><rect x='8' y='3' width='1' height='1' fill='%23300810'/><rect x='1' y='4' width='1' height='1' fill='%23300810'/><rect x='2' y='4' width='4' height='1' fill='%23ff2a4a'/><rect x='6' y='4' width='1' height='1' fill='%23b3122c'/><rect x='7' y='4' width='1' height='1' fill='%23300810'/><rect x='2' y='5' width='1' height='1' fill='%23300810'/><rect x='3' y='5' width='2' height='1' fill='%23ff2a4a'/><rect x='5' y='5' width='1' height='1' fill='%23b3122c'/><rect x='6' y='5' width='1' height='1' fill='%23300810'/><rect x='3' y='6' width='1' height='1' fill='%23300810'/><rect x='4' y='6' width='1' height='1' fill='%23b3122c'/><rect x='5' y='6' width='1' height='1' fill='%23300810'/><rect x='4' y='7' width='1' height='1' fill='%23300810'/></svg>") 0 0 / 100% 100% no-repeat; image-rendering: crisp-edges; image-rendering: pixelated;
  animation: hv3Latido .9s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes hv3Latido {
  0% { transform: translateY(6px) scale(.5); opacity: 0; }
  20% { transform: translateY(-10px) scale(1); opacity: 1; }
  34% { transform: translateY(-12px) scale(1.5); opacity: 1; }
  48% { transform: translateY(-14px) scale(1); opacity: 1; }
  100% { transform: translateY(-36px) scale(1); opacity: 0; }
}
html[data-habitat-v3] .hv3-bandeja .hv3-com[data-pendiente] { opacity: .78; }
html[data-habitat-v3] .hv3-bandeja .hv3-com[data-pendiente] img { animation: hv3Bocado .34s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes hv3Bocado { 0% { transform: scale(.75); } 100% { transform: scale(1); } }
html[data-habitat-v3] .hv3-bandeja .hv3-com[data-revertida] { animation: hv3Revierte .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes hv3Revierte {
  0% { transform: translateX(0); } 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); } 100% { transform: translateX(0); }
}

/* ══ HÁBITAT v3 (H4) · MOCHILA CON ARRASTRE (solo con html[data-habitat-v3]; habitat-mochila.js y companion fuente 38) ══
 * Lámina 06 de rediseno-v2 y tools/habitat_ref/proto/estilos.css (.velo .hoja .asa .cab .pill .tabs .tab .rejilla .item
 * .anillo .nuevo .detalle .chip-r .pista .fantasma .btn.pri y, en el cuarto, .zona .huella .pop .polvo), valores literales.
 * Donde el prototipo usa la curva por defecto (velo .25s, zona .2s) va la de deriva oficial. Tabs de 36 px y asa de 5 px con
 * área táctil de 44 por un ::after (sin sumar alto). La hoja va en body (R192) y reemplaza a pf-inv-* bajo el interruptor. */
html[data-habitat-v3] .hv4-velo {
  position: fixed; inset: 0; z-index: 240; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none;
  transition: opacity .25s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv4-velo[data-on="1"] { opacity: 1; pointer-events: auto; }
html[data-habitat-v3] .hv4-hoja {
  --cian: #22d3ee; --neon: #ff2a4a; --linea: rgba(255, 255, 255, .08); --linea2: rgba(255, 255, 255, .14); --txt: #f4f4f6; --txt2: #a9adbd; --txt3: #6b7080;
  --r-comun: #8b93a7; --r-rara: #3b82f6; --r-epica: #a855f7; --r-legendaria: #f59e0b; --r-power: #ff2a4a;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 241; max-height: 78vh; max-height: 78dvh; display: flex; flex-direction: column;
  width: 100%; max-width: 760px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box;
  border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #14141b 0%, #0b0b10 100%); border-top: 1px solid var(--linea2);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .6); color: var(--txt); font-family: 'Rajdhani', sans-serif; letter-spacing: 0; line-height: normal;
  -webkit-font-smoothing: antialiased; transform: translateY(102%); transition: transform .42s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv4-hoja *, html[data-habitat-v3] .hv4-hoja *::before, html[data-habitat-v3] .hv4-hoja *::after { box-sizing: border-box; }
html[data-habitat-v3] .hv4-hoja[hidden] { display: none; }
html[data-habitat-v3] .hv4-hoja[data-estado="on"] { transform: translateY(0); }
html[data-habitat-v3] .hv4-hoja[data-estado="asoma"] { transform: translateY(calc(100% - 64px)); }
html[data-habitat-v3] .hv4-hoja button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; min-width: 0; min-height: 0;
  -webkit-tap-highlight-color: transparent; text-transform: none; letter-spacing: inherit; box-shadow: none;
  font-family: inherit !important;   /* power-ui.css: .power-hud button { font-family: sistema !important } */
}
html[data-habitat-v3] .hv4-hoja button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv4-hoja img { image-rendering: pixelated; image-rendering: crisp-edges; }
html[data-habitat-v3] .hv4-hoja .hv4-asa { position: relative; display: block; width: 44px; height: 5px; margin: 8px auto 4px; border-radius: 3px; background: #2a2a34; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-hoja .hv4-asa::after { content: ""; position: absolute; left: -10px; right: -10px; top: -20px; bottom: -19px; }
html[data-habitat-v3] .hv4-cab { display: flex; align-items: center; gap: 10px; padding: 4px 16px 8px; min-width: 0; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-cab img { width: 32px; height: 32px; }
html[data-habitat-v3] .hv4-cab h1 { margin: 0; font-family: 'Orbitron', sans-serif; font-size: 13px; letter-spacing: .18em; font-weight: 800; color: var(--txt); line-height: normal; }
html[data-habitat-v3] .hv4-saldos { margin-left: auto; display: flex; gap: 6px; min-width: 0; }
html[data-habitat-v3] .hv4-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 6px; border-radius: 999px; background: #0b0b10; border: 1px solid var(--linea2);
  font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
html[data-habitat-v3] .hv4-pill b { font-weight: 700; }
html[data-habitat-v3] .hv4-pill img { width: 32px; height: 32px; }   /* prototipo: .hoja .cab img (32) le gana a .pill img (20) */
html[data-habitat-v3] .hv4-rayo { width: 20px; height: 20px; display: grid; place-items: center; color: #fbbf24; font-size: 14px; }
html[data-habitat-v3] .hv4-tabs { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-tabs::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv4-hoja .hv4-tab {
  position: relative; flex: 0 0 auto; height: 36px; padding: 0 12px 0 6px; border-radius: 12px; display: flex; align-items: center; gap: 6px;
  background: #101016; border: 1px solid var(--linea); font-weight: 700; font-size: 13px; color: var(--txt2); white-space: nowrap;
}
html[data-habitat-v3] .hv4-hoja .hv4-tab::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; bottom: -9px; }   /* 36 + 8 = 44 px (desde la caja de borde), dentro del relleno de abajo: arriba lo recorta el overflow */
html[data-habitat-v3] .hv4-tab img { width: 28px; height: 28px; }
html[data-habitat-v3] .hv4-tab .c { font-family: 'Orbitron', sans-serif; font-size: 9px; color: var(--txt3); }
html[data-habitat-v3] .hv4-hoja .hv4-tab[aria-selected="true"] { background: #2a0a10; border-color: rgba(232, 38, 58, .7); color: #fff; }
html[data-habitat-v3] .hv4-cuerpo { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
html[data-habitat-v3] .hv4-rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 2px 16px 12px; overflow-y: auto; min-height: 0; flex: 0 1 auto; overscroll-behavior: contain; }
@media (min-width: 640px) { html[data-habitat-v3] .hv4-rejilla { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
html[data-habitat-v3] .hv4-hoja .r-comun { --rc: var(--r-comun); }
html[data-habitat-v3] .hv4-hoja .r-rara { --rc: var(--r-rara); }
html[data-habitat-v3] .hv4-hoja .r-epica { --rc: var(--r-epica); }
html[data-habitat-v3] .hv4-hoja .r-legendaria { --rc: var(--r-legendaria); }
html[data-habitat-v3] .hv4-hoja .r-power { --rc: var(--r-power); }
html[data-habitat-v3] .hv4-hoja .hv4-item {
  position: relative; aspect-ratio: 1 / 1.22; min-height: 68px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 18%, #15151c), #0c0c11 70%); border: 1.5px solid color-mix(in srgb, var(--rc) 55%, transparent);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv4-hoja .hv4-item.r-power { animation: hv4PowerBorde 2.4s steps(2) infinite; }
@keyframes hv4PowerBorde { 50% { border-color: #ff8a96; } }
html[data-habitat-v3] .hv4-item .ico { width: 52px; height: 52px; display: grid; place-items: center; pointer-events: none; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-item .ico img { display: block; pointer-events: none; }
html[data-habitat-v3] .hv4-item .n {
  font-size: 10.5px; font-weight: 700; line-height: 1.05; text-align: center; padding: 0 3px; margin-top: 2px; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
html[data-habitat-v3] .hv4-item .x { position: absolute; top: 4px; right: 5px; font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 #000; }
html[data-habitat-v3] .hv4-item .nuevo { position: absolute; top: 5px; left: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 6px var(--neon); }
html[data-habitat-v3] .hv4-hoja .hv4-item[aria-pressed="true"] { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--rc), 0 8px 18px color-mix(in srgb, var(--rc) 35%, transparent); }
html[data-habitat-v3] .hv4-item .anillo { position: absolute; inset: -3px; border-radius: 16px; pointer-events: none; opacity: 0; }
html[data-habitat-v3] .hv4-item.cargando .anillo {
  opacity: 1; padding: 2px; background: conic-gradient(var(--cian) calc(var(--p, 0) * 1turn), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
html[data-habitat-v3] .hv4-pista { margin: -6px 16px 12px; font-size: 12px; color: var(--txt3); display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-detalle {
  margin: 0 16px 14px; padding: 10px; border-radius: 16px; background: #0b0b10; border: 1px solid var(--linea2); display: flex; gap: 10px; align-items: center; min-width: 0; flex: 0 0 auto;
}
html[data-habitat-v3] .hv4-detalle .ico { width: 64px; height: 64px; display: grid; place-items: center; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-detalle > img { width: 64px; height: 64px; flex: 0 0 auto; }
html[data-habitat-v3] .hv4-vacio > img { opacity: .5; filter: grayscale(1); }
html[data-habitat-v3] .hv4-detalle .tx { flex: 1; min-width: 0; }
html[data-habitat-v3] .hv4-detalle .tx b { display: block; font-size: 16px; line-height: 1.1; font-weight: 700; overflow-wrap: anywhere; }
html[data-habitat-v3] .hv4-detalle .tx small { font-size: 12px; color: var(--txt2); }
html[data-habitat-v3] .hv4-chip-r {
  display: inline-block; font-family: 'Orbitron', sans-serif; font-size: 8px; letter-spacing: .14em; font-weight: 800; padding: 2px 6px; border-radius: 5px; color: #fff; background: var(--rc); margin: 3px 0;
}
html[data-habitat-v3] .hv4-hoja .hv4-btn {
  height: 44px; padding: 0 16px; border-radius: 12px; font-family: 'Orbitron', sans-serif !important; font-size: 10px;   /* H5: el reseteo de botones (inherit !important) le ganaba */ letter-spacing: .14em; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; color: #fff;
  background: linear-gradient(180deg, #ff3b4f, #c81e30); box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
html[data-habitat-v3] .hv4-hoja .hv4-btn[disabled] { cursor: default; opacity: .5; box-shadow: none; }
html[data-habitat-v3] .hv4-ir { padding: 0 16px 16px; }
html[data-habitat-v3] .hv4-hoja .hv4-ir .hv4-btn { width: 100%; }
html[data-habitat-v3] .hv4-fantasma {
  position: fixed; left: 0; top: 0; z-index: 260; width: 84px; height: 84px; pointer-events: none; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .55)); will-change: transform;
}
html[data-habitat-v3] .hv4-fantasma img { width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
/* En el cuarto: grilla del piso (desde la duela) y huella, solo mientras se arrastra. */
html[data-habitat-v3] #power-companion-box > .hv4-zona {
  position: absolute; left: 0; right: 0; bottom: 0; top: 60%; z-index: 2; opacity: 0; pointer-events: none; transition: opacity .2s cubic-bezier(.16, 1, .3, 1);
  background-image: linear-gradient(rgba(34, 211, 238, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, .35) 1px, transparent 1px);
  background-size: 18px 9px; -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%);
}
html[data-habitat-v3] #power-companion-box[data-hv4-arrastre] > .hv4-zona { opacity: 1; }
html[data-habitat-v3] #power-companion-box > .hv4-huella {
  position: absolute; left: 0; top: 0; z-index: 29; width: 58px; height: 16px;   /* encima de muebles (≤ 28) y mascota, debajo de la noche (36) */ pointer-events: none; border-radius: 50%;
  border: 2px solid #22d3ee; background: rgba(34, 211, 238, .18); display: none; box-sizing: border-box;
}
html[data-habitat-v3] #power-companion-box > .hv4-huella[data-estado="ok"] { display: block; }
html[data-habitat-v3] #power-companion-box > .hv4-huella[data-estado="mala"] { display: block; border-color: #ff2a4a; background: rgba(255, 42, 74, .2); }
html[data-habitat-v3] #power-companion-box > .hv4-polvo {
  position: absolute; z-index: 30; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #d8d2c4; pointer-events: none;
  animation: hv4Polvo .6s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes hv4Polvo { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
html[data-habitat-v3] .pet-deco-prop[data-hv4-pop="a"] .pet-deco-ventana,
html[data-habitat-v3] #pet-room-radio[data-hv4-pop="a"] .pet-parlante-ventana { animation: hv4PopA .5s cubic-bezier(.34, 1.56, .64, 1); transform-origin: 50% 100%; }
html[data-habitat-v3] .pet-deco-prop[data-hv4-pop="b"] .pet-deco-ventana,
html[data-habitat-v3] #pet-room-radio[data-hv4-pop="b"] .pet-parlante-ventana { animation: hv4PopB .5s cubic-bezier(.34, 1.56, .64, 1); transform-origin: 50% 100%; }
@keyframes hv4PopA { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes hv4PopB { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .hv4-hoja, html[data-habitat-v3] .hv4-velo, html[data-habitat-v3] .hv4-hoja .hv4-item,
  html[data-habitat-v3] #power-companion-box > .hv4-zona { transition: none; }
  html[data-habitat-v3] .hv4-hoja .hv4-item.r-power,
  html[data-habitat-v3] .pet-deco-prop[data-hv4-pop] .pet-deco-ventana,
  html[data-habitat-v3] #pet-room-radio[data-hv4-pop] .pet-parlante-ventana { animation: none; }
}

/* ══ HÁBITAT v3 (H5) · PULPERÍA Y COMIDA (solo con html[data-habitat-v3]; habitat-pulperia.js y companion fuente 39) ══
 * Lámina 07 (comida) + la Tienda Deco y su modal de la lámina 13 / tools/habitat_ref/proto/estilos.css (.cab .sub .filtros
 * .vitrina .carta .prev .n .pie .cinta .tengo .modal-velo .modal .rayos .heroe .desc .cuentas .obtener .acciones .cerrar .btn),
 * valores literales. La hoja es la de la mochila (.hv4-hoja). Donde el prototipo usa la curva por defecto (fade .25s) va la de
 * deriva oficial; los rayos giran con steps(360) (nunca una curva lineal). Filtros de 34 px con área de 44 por un ::after. */
html[data-habitat-v3] .hv5-cab .sub { font-size: 11px; color: var(--txt3); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; line-height: normal; }
html[data-habitat-v3] .hv5-hoja .hv4-pill img, html[data-habitat-v3] .hv5-modal .hv4-pill img { width: 20px; height: 20px; }
html[data-habitat-v3] .hv5-hoja .hv5-cab .hv4-pill img { width: 32px; height: 32px; }   /* como la mochila: .hoja .cab img (32) */
html[data-habitat-v3] .hv5-filtros { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
html[data-habitat-v3] .hv5-filtros::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv5-hoja .hv5-filtros button {
  position: relative; flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 999px; background: #101016; border: 1px solid var(--linea);
  font-weight: 700; font-size: 13px; color: var(--txt2); white-space: nowrap;
}
html[data-habitat-v3] .hv5-hoja .hv5-filtros button::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; bottom: -11px; }   /* 34 + 10 = 44 px */
html[data-habitat-v3] .hv5-hoja .hv5-filtros button[aria-pressed="true"] { background: #fff; color: #0b0b10; border-color: #fff; }
html[data-habitat-v3] .hv5-cuerpo { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 2px 16px 16px; }
html[data-habitat-v3] .hv5-vitrina { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { html[data-habitat-v3] .hv5-vitrina { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
html[data-habitat-v3] .hv5-hoja .hv5-carta, html[data-habitat-v3] .hv5-modal-velo { --r-comun: #8b93a7; --r-rara: #3b82f6; --r-epica: #a855f7; --r-legendaria: #f59e0b; --r-power: #ff2a4a; }
html[data-habitat-v3] .hv5-modal-velo .r-comun { --rc: var(--r-comun); }
html[data-habitat-v3] .hv5-modal-velo .r-rara { --rc: var(--r-rara); }
html[data-habitat-v3] .hv5-modal-velo .r-epica { --rc: var(--r-epica); }
html[data-habitat-v3] .hv5-modal-velo .r-legendaria { --rc: var(--r-legendaria); }
html[data-habitat-v3] .hv5-modal-velo .r-power { --rc: var(--r-power); }
html[data-habitat-v3] .hv5-hoja .hv5-carta {
  position: relative; border-radius: 18px; padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; overflow: hidden; min-width: 0; min-height: 68px;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rc) 22%, #16161d), #0b0b10 72%); border: 1.5px solid color-mix(in srgb, var(--rc) 60%, transparent);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv5-hoja .hv5-carta:active { transform: scale(.97); }
html[data-habitat-v3] .hv5-carta .prev { height: 120px; display: grid; place-items: center; position: relative; pointer-events: none; }
html[data-habitat-v3] .hv5-carta .prev img { display: block; width: 96px; height: 96px; }
html[data-habitat-v3] .hv5-carta .hv4-chip-r { align-self: flex-start; }
html[data-habitat-v3] .hv5-carta .n { font-size: 15px; font-weight: 700; line-height: 1.05; overflow-wrap: anywhere; }
html[data-habitat-v3] .hv5-carta .e { font-size: 13px; font-weight: 700; line-height: 1; color: #7cffb2; margin-top: -2px; }
html[data-habitat-v3] .hv5-carta .ex { font-size: 11px; line-height: 1.1; color: var(--txt3); margin-top: -3px; }
html[data-habitat-v3] .hv5-carta .pie { display: flex; align-items: center; gap: 6px; margin-top: auto; min-width: 0; }
html[data-habitat-v3] .hv5-carta .pie .hv4-pill { height: 26px; font-size: 11px; flex: 0 0 auto; }
html[data-habitat-v3] .hv5-pill s { margin-left: 4px; font-size: 9px; color: var(--txt3); font-weight: 600; }
html[data-habitat-v3] .hv5-hoja .hv5-evento { color: #ff2a4a; padding: 0 10px; }
html[data-habitat-v3] .hv5-carta .cinta {
  position: absolute; top: 12px; right: -30px; width: 110px; transform: rotate(35deg); text-align: center; font-family: 'Orbitron', sans-serif; font-size: 8px;
  letter-spacing: .14em; font-weight: 900; background: #ff2a4a; color: #fff; padding: 3px 0; box-shadow: 0 0 12px rgba(255, 42, 74, .7); z-index: 1; pointer-events: none;
}
html[data-habitat-v3] .hv5-carta .tengo { margin-left: auto; font-family: 'Orbitron', sans-serif; font-size: 8px; letter-spacing: .12em; color: #7cffb2; font-weight: 800; text-align: right; min-width: 0; }
html[data-habitat-v3] .hv5-carta.r-legendaria::after, html[data-habitat-v3] .hv5-carta.r-power::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .12) 45%, transparent 60%);
  transform: translateX(-100%); animation: hv5Barre 3.2s cubic-bezier(.16, 1, .3, 1) infinite; pointer-events: none;
}
@keyframes hv5Barre { 60%, 100% { transform: translateX(100%); } }
html[data-habitat-v3] .hv5-nota { margin: 12px 2px 0; font-size: 12px; color: var(--txt3); line-height: 1.25; }
/* Modal de compra (en body, encima de la hoja). */
html[data-habitat-v3] .hv5-modal-velo {
  --linea: rgba(255, 255, 255, .08); --linea2: rgba(255, 255, 255, .14); --txt: #f4f4f6; --txt2: #a9adbd; --txt3: #6b7080;
  position: fixed; inset: 0; z-index: 250; background: rgba(3, 3, 6, .72); display: grid; place-items: center; padding: 18px; box-sizing: border-box;
  color: var(--txt); font-family: 'Rajdhani', sans-serif; letter-spacing: 0; line-height: normal; -webkit-font-smoothing: antialiased;
  animation: hv5Fade .25s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv5-modal-velo[hidden] { display: none; }
html[data-habitat-v3] .hv5-modal-velo *, html[data-habitat-v3] .hv5-modal-velo *::before, html[data-habitat-v3] .hv5-modal-velo *::after { box-sizing: border-box; }
@keyframes hv5Fade { from { opacity: 0; } }
html[data-habitat-v3] .hv5-modal-velo button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; min-width: 0; min-height: 0;
  -webkit-tap-highlight-color: transparent; text-transform: none; letter-spacing: inherit; box-shadow: none;
  font-family: inherit !important;   /* power-ui.css: .power-hud button { font-family: sistema !important } */
}
html[data-habitat-v3] .hv5-modal-velo button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv5-modal-velo img { image-rendering: pixelated; image-rendering: crisp-edges; }
html[data-habitat-v3] .hv5-modal {
  width: 100%; max-width: 420px; max-height: 100%; overflow: hidden auto; border-radius: 26px; padding: 16px; position: relative; display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--rc) 30%, #14141b), #0b0b10 65%); border: 1.5px solid color-mix(in srgb, var(--rc) 70%, transparent);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6), 0 0 40px color-mix(in srgb, var(--rc) 25%, transparent); animation: hv5Mod .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes hv5Mod { from { transform: scale(.88) translateY(16px); opacity: 0; } }
html[data-habitat-v3] .hv5-modal .rayos {
  position: absolute; left: 50%; top: 96px; width: 420px; height: 420px; margin: -210px 0 0 -210px; pointer-events: none; opacity: .6;
  background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 20%, transparent) 0 8deg, transparent 8deg 24deg); animation: hv5Gira 24s steps(360) infinite;
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 60%); mask-image: radial-gradient(circle, #000 20%, transparent 60%);
}
@keyframes hv5Gira { to { transform: rotate(360deg); } }
html[data-habitat-v3] .hv5-modal .cerrar { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 12px; background: rgba(0, 0, 0, .5); border: 1px solid var(--linea2); font-size: 18px; z-index: 2; }
html[data-habitat-v3] .hv5-modal .heroe { height: 170px; display: grid; place-items: center; position: relative; flex: 0 0 auto; }
html[data-habitat-v3] .hv5-modal .heroe img { display: block; width: 128px; height: 128px; }
html[data-habitat-v3] .hv5-modal .heroe[data-pop] img { animation: hv5Pop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes hv5Pop { 0% { transform: scale(1); } 40% { transform: scale(1.18) translateY(-6px); } 100% { transform: scale(1); } }
html[data-habitat-v3] .hv5-mas {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 13px; color: #7cffb2; white-space: nowrap;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .8); animation: hv5Mas 1.1s cubic-bezier(.16, 1, .3, 1) forwards; pointer-events: none;
}
@keyframes hv5Mas { from { opacity: 0; transform: translate(-50%, 10px); } 25% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -14px); } }
html[data-habitat-v3] .hv5-modal .hv4-chip-r {
  display: inline-block; align-self: center; font-family: 'Orbitron', sans-serif; font-size: 8px; letter-spacing: .14em; font-weight: 800; padding: 2px 6px; border-radius: 5px; color: #fff; background: var(--rc); margin: 3px 0;
}
html[data-habitat-v3] .hv5-modal h3 { margin: 0; font-family: 'Orbitron', sans-serif; font-size: 18px; font-weight: 900; text-align: center; color: var(--txt); line-height: normal; }
html[data-habitat-v3] .hv5-modal .desc { margin: 0; font-size: 14px; color: var(--txt2); text-align: center; line-height: 1.25; }
html[data-habitat-v3] .hv5-modal .obtener { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
html[data-habitat-v3] .hv5-modal .obtener span { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: #101016; border: 1px solid var(--linea2); color: var(--txt2); }
html[data-habitat-v3] .hv5-modal .cuentas { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .4); border: 1px solid var(--linea); font-size: 14px; position: relative; }
html[data-habitat-v3] .hv5-modal .cuentas b { font-family: 'Orbitron', sans-serif; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
html[data-habitat-v3] .hv5-modal .cuentas .tot { border-top: 1px solid var(--linea2); padding-top: 4px; }
html[data-habitat-v3] .hv5-modal .hv5-cu { height: auto; padding: 0; border: 0; background: none; font-size: 12px; }
html[data-habitat-v3] .hv5-modal .hv4-pill {
  display: inline-flex; align-items: center; gap: 4px; font-family: 'Orbitron', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums;
}
html[data-habitat-v3] .hv5-tenes, html[data-habitat-v3] .hv5-ganar { margin: 0; font-size: 13px; color: var(--txt2); text-align: center; line-height: 1.25; position: relative; }
html[data-habitat-v3] .hv5-ganar { color: #fbbf24; }
html[data-habitat-v3] .hv5-modal .acciones { display: flex; gap: 8px; position: relative; }
html[data-habitat-v3] .hv5-modal-velo .hv5-btn {
  flex: 1; height: 44px; padding: 0 16px; border-radius: 12px; font-family: 'Orbitron', sans-serif !important; font-size: 10px; letter-spacing: .14em; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
html[data-habitat-v3] .hv5-modal-velo .hv5-btn.pri { background: linear-gradient(180deg, #ff3b4f, #c81e30); color: #fff; box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
html[data-habitat-v3] .hv5-modal-velo .hv5-btn.sec { background: #14141b; border: 1px solid var(--linea2); color: var(--txt); }
html[data-habitat-v3] .hv5-modal-velo .hv5-btn img { width: 20px; height: 20px; }
html[data-habitat-v3] .hv5-modal-velo .hv5-btn[data-falta] { background: #2a0a10; border: 1px solid rgba(232, 38, 58, .7); box-shadow: none; padding: 0 8px; gap: 4px; white-space: nowrap; }
/* En el cuarto: el bocado junto a la boca mientras come (transform + opacity; lo ubica companion fuente 39). */
html[data-habitat-v3] #power-companion-box > .hv5-bocado {
  position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; opacity: 0; image-rendering: pixelated; image-rendering: crisp-edges;
}
html[data-habitat-v3] #power-companion-box > .hv5-bocado[data-on] { animation: hv5Bocado 1.3s steps(4) forwards; }
@keyframes hv5Bocado { 0% { opacity: 1; scale: 1; } 30% { opacity: 1; scale: .8; } 60% { opacity: 1; scale: .55; } 85% { opacity: 1; scale: .3; } 100% { opacity: 0; scale: .3; } }
/* La sobrecarga de las energéticas (energía > 100): la barra llena con brillo. */
html[data-habitat-v3] .hv3-mini[data-sobre] i { box-shadow: 0 0 0 1px #fbbf24, 0 0 8px rgba(251, 191, 36, .7); }
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .hv5-modal-velo, html[data-habitat-v3] .hv5-modal, html[data-habitat-v3] .hv5-modal .rayos, html[data-habitat-v3] .hv5-carta::after,
  html[data-habitat-v3] .hv5-modal .heroe[data-pop] img { animation: none; }
  html[data-habitat-v3] #power-companion-box > .hv5-bocado[data-on] { animation: none; opacity: 1; }
}

/* ══ HÁBITAT v3 (H9 · selector) · SELECTOR DE MASCOTA (solo con html[data-habitat-v3]; habitat-selector.js) ══
 * Lámina 14 de rediseno-v2 y tools/habitat_ref/proto/estilos.css (.sel .escenario .luz .pedestal .anillo .heroe .nav .tag .nuevo
 * .ficha .cromas .barra-st .tira .btn.pri .cab .cerrar), valores literales. Cambios declarados: el anillo gira con steps(480)
 * (el prototipo gira a ritmo constante sin pasos), la respiración y la entrada con la curva de deriva oficial (el prototipo usa una curva genérica), las
 * barras llenan con scaleX (el prototipo usa width), los puntos de croma son botones con área de 30 × 44 (los separa un gap de
 * 8 px: 44 de ancho pisaría al vecino) y cada carta de la tira suma 3 px de área por un ::after (44 desde 360 px). */
html[data-habitat-v3] .hv9-capa {
  --bg: #07070a; --panel: #0e0e13; --linea: rgba(255, 255, 255, .08); --linea2: rgba(255, 255, 255, .14); --txt: #f4f4f6; --txt2: #a9adbd; --txt3: #6b7080;
  --rojo: #e8263a; --neon: #ff2a4a; --oro: #fbbf24;
  position: fixed; inset: 0; z-index: 245; background: var(--bg); color: var(--txt); font-family: 'Rajdhani', sans-serif; font-weight: 500; letter-spacing: 0; line-height: normal;
  text-transform: none; -webkit-font-smoothing: antialiased; opacity: 0; transform: translateY(12px);
  transition: opacity .32s cubic-bezier(.16, 1, .3, 1), transform .32s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv9-capa[hidden] { display: none; }
html[data-habitat-v3] .hv9-capa:focus { outline: none; }
html[data-habitat-v3] .hv9-capa[data-estado="on"] { opacity: 1; transform: translateY(0); }
html[data-habitat-v3] .hv9-capa *, html[data-habitat-v3] .hv9-capa *::before, html[data-habitat-v3] .hv9-capa *::after { box-sizing: border-box; margin: 0; padding: 0; }
html[data-habitat-v3] .hv9-capa button {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer; min-width: 0; min-height: 0; -webkit-tap-highlight-color: transparent;
  text-transform: none; letter-spacing: inherit; box-shadow: none; text-shadow: none;
  font-family: inherit !important;   /* power-ui.css: .power-hud button { font-family: sistema !important } */
}
html[data-habitat-v3] .hv9-capa button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv9-capa canvas { display: block; image-rendering: pixelated; }
html[data-habitat-v3] .hv9-pantalla {
  position: absolute; inset: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 14px 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}
html[data-habitat-v3] .hv9-pantalla::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv9-sel { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; min-width: 0; margin: 0 auto; }
html[data-habitat-v3] .hv9-sel > * { min-width: 0; flex: 0 0 auto; }
/* cabecera */
html[data-habitat-v3] .hv9-cab { display: flex; align-items: center; gap: 10px; }
html[data-habitat-v3] .hv9-cab-t { min-width: 0; }
html[data-habitat-v3] .hv9-cab .sub { font-size: 11px; color: var(--txt3); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
html[data-habitat-v3] .hv9-cab h1 { font-family: 'Orbitron', sans-serif; font-size: 13px; letter-spacing: .18em; font-weight: 800; color: var(--txt); line-height: normal; white-space: nowrap; }
html[data-habitat-v3] .hv9-capa .hv9-cerrar {
  position: static; margin-left: auto; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: rgba(0, 0, 0, .5); border: 1px solid var(--linea2); font-size: 18px;
}
/* escenario */
html[data-habitat-v3] .hv9-escenario {
  position: relative; height: 330px; border-radius: 24px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse at 50% 85%, rgba(232, 38, 58, .25), transparent 55%), radial-gradient(ellipse at 50% 0%, #1b1b26, #08080c 70%);
  border: 1px solid var(--linea);
}
html[data-habitat-v3] .hv9-escenario .luz {
  position: absolute; left: 50%; top: -40px; width: 240px; height: 330px; transform: translateX(-50%); background: linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 80%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); pointer-events: none;
}
html[data-habitat-v3] .hv9-escenario .pedestal {
  position: absolute; left: 50%; bottom: 34px; width: 200px; height: 46px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, #2a2a34 0%, #121218 60%, transparent 62%); box-shadow: 0 0 0 2px rgba(232, 38, 58, .45), 0 0 30px rgba(232, 38, 58, .35);
}
html[data-habitat-v3] .hv9-escenario .anillo {
  position: absolute; left: 50%; bottom: 30px; width: 236px; height: 56px; transform: translateX(-50%); border-radius: 50%; border: 2px dashed rgba(255, 42, 74, .45);
  animation: hv9Gira 16s steps(480) infinite;
}
@keyframes hv9Gira {
  to { transform: translateX(-50%) rotate(360deg); }
}
html[data-habitat-v3] .hv9-escenario .heroe {
  position: absolute; left: 50%; bottom: 52px; width: 192px; height: 192px; transform: translateX(-50%); pointer-events: none;
  animation: hv9Respira 2.4s cubic-bezier(.16, 1, .3, 1) infinite;
}
@keyframes hv9Respira {
  50% { transform: translateX(-50%) translateY(-3px); }
}
html[data-habitat-v3] .hv9-escenario .heroe canvas { width: 192px; height: 192px; }
html[data-habitat-v3] .hv9-escenario .heroe canvas[data-dir="der"] { --hv9-dx: 16px; }
html[data-habitat-v3] .hv9-escenario .heroe canvas[data-dir="izq"] { --hv9-dx: -16px; }
html[data-habitat-v3] .hv9-escenario .heroe canvas[data-dir][data-paso="a"] { animation: hv9EntraA .34s cubic-bezier(.16, 1, .3, 1); }
html[data-habitat-v3] .hv9-escenario .heroe canvas[data-dir][data-paso="b"] { animation: hv9EntraB .34s cubic-bezier(.16, 1, .3, 1); }
@keyframes hv9EntraA {
  from { opacity: 0; transform: translateX(var(--hv9-dx, 16px)); }
}
@keyframes hv9EntraB {
  from { opacity: 0; transform: translateX(var(--hv9-dx, 16px)); }
}
html[data-habitat-v3] .hv9-capa .hv9-escenario .nav {
  position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 14px; background: rgba(0, 0, 0, .55); border: 1px solid var(--linea2);
  display: grid; place-items: center; font-size: 22px; font-weight: 900; z-index: 1;
}
html[data-habitat-v3] .hv9-escenario .nav.izq { left: 10px; }
html[data-habitat-v3] .hv9-escenario .nav.der { right: 10px; }
html[data-habitat-v3] .hv9-escenario .tag { position: absolute; left: 14px; top: 12px; font-family: 'Orbitron', sans-serif; font-size: 9px; letter-spacing: .2em; color: var(--txt3); font-weight: 700; }
html[data-habitat-v3] .hv9-escenario .nuevo {
  position: absolute; right: 14px; top: 12px; display: inline-block; font-family: 'Orbitron', sans-serif; font-size: 8px; letter-spacing: .14em; font-weight: 800;
  padding: 2px 6px; border-radius: 5px; color: #fff; background: var(--neon); margin: 3px 0;
}
html[data-habitat-v3] .hv9-escenario .nuevo[hidden] { display: none; }
/* ficha */
html[data-habitat-v3] .hv9-ficha { padding: 12px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--linea); display: flex; flex-direction: column; gap: 8px; }
html[data-habitat-v3] .hv9-fila { display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-habitat-v3] .hv9-ficha h2 {
  font-family: 'Orbitron', sans-serif; font-size: 20px; font-weight: 900; letter-spacing: .04em; color: var(--txt); line-height: normal; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[data-habitat-v3] .hv9-ficha p { font-size: 14px; color: var(--txt2); line-height: 1.25; }
html[data-habitat-v3] .hv9-ficha .hv9-hambre { margin-top: 8px; font-size: 13px; font-weight: 700; color: #ffb020; }   /* t-mascota-hambre · aviso amable (ámbar = el hambre de mascota-dialogos) */
html[data-habitat-v3] .hv9-ficha .cromas { display: flex; gap: 8px; margin-left: auto; flex: 0 0 auto; }
html[data-habitat-v3] .hv9-capa .hv9-ficha .cromas button { position: relative; display: block; width: 22px; height: 22px; border-radius: 50%; }
html[data-habitat-v3] .hv9-ficha .cromas button::after { content: ""; position: absolute; left: -4px; right: -4px; top: -11px; bottom: -11px; }
html[data-habitat-v3] .hv9-ficha .cromas i { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #0b0b10; box-shadow: 0 0 0 1px var(--linea2); }
html[data-habitat-v3] .hv9-ficha .cromas [data-on] i { box-shadow: 0 0 0 2px #fff; }
html[data-habitat-v3] .hv9-ficha .cromas [data-vista] i { box-shadow: 0 0 0 2px var(--neon); }
html[data-habitat-v3] .hv9-ficha .cromas [data-lock] i { opacity: .45; }
html[data-habitat-v3] .hv9-ficha .barra-st {
  display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: 8px; font-family: 'Orbitron', sans-serif; font-size: 9px; letter-spacing: .12em; font-weight: 700;
}
html[data-habitat-v3] .hv9-ficha .barra-st > * { min-width: 0; }
html[data-habitat-v3] .hv9-ficha .barra-st i { display: block; height: 8px; border-radius: 4px; background: #22222a; overflow: hidden; }
html[data-habitat-v3] .hv9-ficha .barra-st i b { display: block; width: 100%; height: 100%; transform-origin: 0 50%; transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
/* tira de las 7 */
html[data-habitat-v3] .hv9-tira { display: flex; gap: 6px; justify-content: space-between; }
html[data-habitat-v3] .hv9-capa .hv9-tira button {
  flex: 1; min-width: 0; aspect-ratio: 1; border-radius: 14px; background: #101016; border: 1px solid var(--linea); position: relative;
}
html[data-habitat-v3] .hv9-tira button::after { content: ""; position: absolute; inset: -3px; }
html[data-habitat-v3] .hv9-tira button canvas { width: 100%; height: 100%; border-radius: 13px; }
html[data-habitat-v3] .hv9-capa .hv9-tira button[aria-current="true"] { border-color: var(--rojo); box-shadow: 0 0 0 1px var(--rojo); }
html[data-habitat-v3] .hv9-tira button .lock { position: absolute; inset: 0; border-radius: 13px; background: rgba(0, 0, 0, .55); display: grid; place-items: center; font-size: 14px; }
/* CTA único y compra */
html[data-habitat-v3] .hv9-capa .hv9-btn {
  height: 44px; padding: 0 16px; border-radius: 12px; font-family: 'Orbitron', sans-serif !important; font-size: 10px; letter-spacing: .14em; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; white-space: nowrap; overflow: hidden;
}
html[data-habitat-v3] .hv9-capa .hv9-btn.pri { background: linear-gradient(180deg, #ff3b4f, #c81e30); color: #fff; box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
html[data-habitat-v3] .hv9-capa .hv9-btn.sec { background: #14141b; border: 1px solid var(--linea2); color: var(--txt); }
html[data-habitat-v3] .hv9-capa .hv9-btn[disabled] { cursor: default; opacity: .5; box-shadow: none; }
html[data-habitat-v3] .hv9-capa .hv9-btn[aria-disabled="true"] { cursor: default; }
html[data-habitat-v3] .hv9-sel > .hv9-btn { width: 100%; }
html[data-habitat-v3] .hv9-compra {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(180deg, #16161e, #0b0b10); border: 1px solid rgba(232, 38, 58, .55); box-shadow: 0 -12px 30px rgba(0, 0, 0, .6), 0 0 14px rgba(232, 38, 58, .25);
  animation: hv9Compra .3s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv9-compra[hidden] { display: none; }
@keyframes hv9Compra {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
}
html[data-habitat-v3] .hv9-compra p { font-size: 15px; font-weight: 600; color: var(--txt); line-height: 1.25; text-align: center; }
html[data-habitat-v3] .hv9-compra .msg { font-size: 13px; color: var(--oro); min-height: 16px; }
html[data-habitat-v3] .hv9-compra .acciones { display: flex; gap: 8px; }
html[data-habitat-v3] .hv9-compra .acciones .hv9-btn { flex: 1; min-width: 0; }
/* Con el selector encima la página no se ve: sus animaciones se pausan y no se desplaza (lección §7.291). */
html[data-habitat-v3][data-hv9-abierto], html[data-habitat-v3][data-hv9-abierto] body { overflow: hidden; }
html[data-habitat-v3][data-hv9-abierto] body > :not(#hv9-sel), html[data-habitat-v3][data-hv9-abierto] body > :not(#hv9-sel) *,
html[data-habitat-v3][data-hv9-abierto] body > :not(#hv9-sel) *::before, html[data-habitat-v3][data-hv9-abierto] body > :not(#hv9-sel) *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .hv9-capa, html[data-habitat-v3] .hv9-ficha .barra-st i b { transition: none; }
  html[data-habitat-v3] .hv9-escenario .anillo, html[data-habitat-v3] .hv9-escenario .heroe,
  html[data-habitat-v3] .hv9-escenario .heroe canvas[data-dir][data-paso], html[data-habitat-v3] .hv9-compra { animation: none; }
}
/* ══ HÁBITAT v3 (H9 · tienda deco) · TIENDA DECO Y MODAL DE COMPRA (solo con html[data-habitat-v3]; companion fuente 42) ══
 * Lámina 13 de rediseno-v2 y tools/habitat_ref/proto/estilos.css (.cab .sub .pill .filtros .vitrina .carta .prev .spr .n .pie .cinta
 * .tengo .chip-r .r-* y el modal), valores literales. La tienda va en el panel Decoración (#deco-tienda-v3, al lado de #deco-tienda,
 * que queda oculto y sin pintar); el modal usa el mismo diálogo de la Pulpería (.hv5-modal-velo · .hv5-modal · .hv5-btn, H5) y acá
 * solo se le suma lo de la Deco. La vista animada corre la hoja con transform y steps(N) (N = cuadros de la hoja), nunca con
 * background-position. Los rayos son un conic-gradient de 15 cuñas escritas una por una (sin repeating-*), giran con steps(360).
 * Filtros de 34 px y colores de 44 px de área. Solo transform y opacity se animan; curvas oficiales. */
html[data-habitat-v3] #hud-panel-decoracion .hud-panel-inner > .w-full > .flex:first-child { display: none; }   /* el rótulo «Decoración»: la tienda trae su cabecera */
html[data-habitat-v3] .hv9d-tienda {
  --linea: rgba(255, 255, 255, .08); --linea2: rgba(255, 255, 255, .14); --txt: #f4f4f6; --txt2: #a9adbd; --txt3: #6b7080; --neon: #ff2a4a;
  --r-comun: #8b93a7; --r-rara: #3b82f6; --r-epica: #a855f7; --r-legendaria: #f59e0b; --r-power: #ff2a4a;
  display: flex; flex-direction: column; gap: 12px; min-width: 0; width: 100%; color: var(--txt); font-family: 'Rajdhani', sans-serif; letter-spacing: 0;
  line-height: normal; text-align: left; -webkit-font-smoothing: antialiased;
}
html[data-habitat-v3] .hv9d-tienda *, html[data-habitat-v3] .hv9d-tienda *::before, html[data-habitat-v3] .hv9d-tienda *::after { box-sizing: border-box; }
html[data-habitat-v3] .hv9d-tienda button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; min-width: 0; min-height: 0;
  -webkit-tap-highlight-color: transparent; text-transform: none; letter-spacing: inherit; box-shadow: none; text-align: inherit;
  font-family: inherit !important;   /* power-ui.css: .power-hud button { font-family: sistema !important } */
}
html[data-habitat-v3] .hv9d-tienda button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv9d-tienda img, html[data-habitat-v3] .hv9d-modal-velo .hv9d-ico { image-rendering: crisp-edges; image-rendering: pixelated; }   /* la última gana: pixelated */
html[data-habitat-v3] .hv9d-tienda .r-comun, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var.r-comun { --rc: var(--r-comun); }
html[data-habitat-v3] .hv9d-tienda .r-rara, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var.r-rara { --rc: var(--r-rara); }
html[data-habitat-v3] .hv9d-tienda .r-epica, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var.r-epica { --rc: var(--r-epica); }
html[data-habitat-v3] .hv9d-tienda .r-legendaria, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var.r-legendaria { --rc: var(--r-legendaria); }
html[data-habitat-v3] .hv9d-tienda .r-power, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var.r-power { --rc: var(--r-power); }
/* Cabecera (prototipo .cab) y la píldora única (.hv4-pill, 28 px, H4) */
html[data-habitat-v3] .hv9d-cab { display: flex; align-items: center; gap: 10px; min-width: 0; }
html[data-habitat-v3] .hv9d-cab > img { width: 32px; height: 32px; flex: 0 0 auto; }
html[data-habitat-v3] .hv9d-cab > div:not(.hv4-saldos) { min-width: 0; }
html[data-habitat-v3] .hv9d-cab h1 { margin: 0; font-family: 'Orbitron', sans-serif; font-size: 13px; letter-spacing: .18em; font-weight: 800; color: var(--txt); line-height: normal; white-space: nowrap; }
html[data-habitat-v3] .hv9d-cab .sub { font-size: 11px; color: var(--txt3); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; line-height: normal; }
html[data-habitat-v3] .hv9d-cab .hv4-pill { color: var(--txt); }
html[data-habitat-v3] .hv9d-aviso, html[data-habitat-v3] .hv9d-aviso-m {
  margin: 0; padding: 8px 12px; border-radius: 12px; background: #2a0a10; border: 1px solid rgba(232, 38, 58, .7); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; position: relative;
}
html[data-habitat-v3] .hv9d-aviso[hidden] { display: none; }
/* Filtros (prototipo .filtros): chips de 34 px, el activo blanco; área de 44 por un ::after */
html[data-habitat-v3] .hv9d-filtros { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; margin-bottom: -10px; min-width: 0; flex: 0 0 auto; }
html[data-habitat-v3] .hv9d-filtros::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv9d-tienda .hv9d-filtros button {
  position: relative; flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 999px; background: #101016; border: 1px solid var(--linea);
  font-weight: 700; font-size: 13px; color: var(--txt2); white-space: nowrap;
}
html[data-habitat-v3] .hv9d-tienda .hv9d-filtros button::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; bottom: -11px; }   /* 34 + 10 = 44 px */
html[data-habitat-v3] .hv9d-tienda .hv9d-filtros button[aria-pressed="true"] { background: #fff; color: #0b0b10; border-color: #fff; }
/* Vitrina y cartas (prototipo .vitrina .carta) */
html[data-habitat-v3] .hv9d-vitrina { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; }
@media (min-width: 640px) { html[data-habitat-v3] .hv9d-vitrina { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
html[data-habitat-v3] .hv9d-tienda .hv9d-carta {
  position: relative; border-radius: 18px; padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; overflow: hidden; min-width: 0; min-height: 44px;
  text-align: center;   /* prototipo: un <button> sin text-align (centrado por defecto); el chip va a la izquierda por align-self */
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rc) 22%, #16161d), #0b0b10 72%); border: 1.5px solid color-mix(in srgb, var(--rc) 60%, transparent);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv9d-tienda .hv9d-carta:active { transform: scale(.97); }
html[data-habitat-v3] .hv9d-carta .prev { height: 120px; display: grid; place-items: center; position: relative; pointer-events: none; }
html[data-habitat-v3] .hv9d-carta .prev .hv9d-ico { display: block; width: 96px; height: 96px; }
html[data-habitat-v3] .hv9d-spr { position: relative; display: block; overflow: hidden; flex: 0 0 auto; }
html[data-habitat-v3] .hv9d-spr > i {
  position: absolute; left: 0; top: 0; display: block; background-repeat: no-repeat; background-position: 0 0; background-size: 100% 100%;
  image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; image-rendering: pixelated;
}
html[data-habitat-v3] .hv9d-spr > i[data-n] { animation: hv9dTira var(--d, 1200ms) steps(var(--n, 1)) infinite; }
@keyframes hv9dTira {
  to { transform: translateX(-100%); }
}
html[data-habitat-v3] .hv9d-carta .hv4-chip-r { align-self: flex-start; }
html[data-habitat-v3] .hv9d-carta .n { font-size: 15px; font-weight: 700; line-height: 1.05; overflow-wrap: anywhere; }
html[data-habitat-v3] .hv9d-carta .v { font-size: 11px; line-height: 1.1; color: var(--txt3); margin-top: -3px; font-weight: 600; overflow-wrap: anywhere; }
html[data-habitat-v3] .hv9d-carta .pie { display: flex; align-items: center; gap: 6px; margin-top: auto; min-width: 0; }
html[data-habitat-v3] .hv9d-carta .pie .hv4-pill { height: 26px; font-size: 11px; flex: 0 0 auto; }
html[data-habitat-v3] .hv9d-carta .pie .hv9d-gratis { padding: 0 10px; color: #7cffb2; }
html[data-habitat-v3] .hv9d-carta .cinta {
  position: absolute; top: 12px; right: -30px; width: 110px; transform: rotate(35deg); text-align: center; font-family: 'Orbitron', sans-serif; font-size: 8px;
  letter-spacing: .14em; font-weight: 900; background: #ff2a4a; color: #fff; padding: 3px 0; box-shadow: 0 0 12px rgba(255, 42, 74, .7); z-index: 1; pointer-events: none;
}
html[data-habitat-v3] .hv9d-carta .tengo { margin-left: auto; font-family: 'Orbitron', sans-serif; font-size: 8px; letter-spacing: .12em; color: #7cffb2; font-weight: 800; text-align: right; min-width: 0; }
html[data-habitat-v3] .hv9d-carta .tengo.is-uso { color: #22d3ee; }
html[data-habitat-v3] .hv9d-carta.r-legendaria::after, html[data-habitat-v3] .hv9d-carta.r-power::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .12) 45%, transparent 60%);
  transform: translateX(-100%); animation: hv9dBarre 3.2s cubic-bezier(.16, 1, .3, 1) infinite; pointer-events: none;
}
@keyframes hv9dBarre {
  60%, 100% { transform: translateX(100%); }
}
/* POWER: el borde late (prototipo powerborde) con una capa que solo cambia de opacidad */
html[data-habitat-v3] .hv9d-carta.r-power::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: 18px; border: 1.5px solid #ff8a96; opacity: 0; pointer-events: none;
  animation: hv9dPulso 2.4s steps(2) infinite;
}
@keyframes hv9dPulso {
  50% { opacity: 1; }
}
/* ── Modal (el de la Pulpería, H5) · lo propio de la Deco ── */
html[data-habitat-v3] .hv9d-modal-velo .rayos {
  --hv9d-ray: color-mix(in srgb, var(--rc) 20%, transparent);
  background: conic-gradient(var(--hv9d-ray) 0deg 8deg, transparent 8deg 24deg, var(--hv9d-ray) 24deg 32deg, transparent 32deg 48deg, var(--hv9d-ray) 48deg 56deg, transparent 56deg 72deg, var(--hv9d-ray) 72deg 80deg, transparent 80deg 96deg, var(--hv9d-ray) 96deg 104deg, transparent 104deg 120deg, var(--hv9d-ray) 120deg 128deg, transparent 128deg 144deg, var(--hv9d-ray) 144deg 152deg, transparent 152deg 168deg, var(--hv9d-ray) 168deg 176deg, transparent 176deg 192deg, var(--hv9d-ray) 192deg 200deg, transparent 200deg 216deg, var(--hv9d-ray) 216deg 224deg, transparent 224deg 240deg, var(--hv9d-ray) 240deg 248deg, transparent 248deg 264deg, var(--hv9d-ray) 264deg 272deg, transparent 272deg 288deg, var(--hv9d-ray) 288deg 296deg, transparent 296deg 312deg, var(--hv9d-ray) 312deg 320deg, transparent 320deg 336deg, var(--hv9d-ray) 336deg 344deg, transparent 344deg 360deg);
}
html[data-habitat-v3] .hv9d-modal-velo .heroe .hv9d-ico { display: block; width: 96px; height: 96px; }
html[data-habitat-v3] .hv9d-modal-velo .heroe[data-pop] .hv9d-spr, html[data-habitat-v3] .hv9d-modal-velo .heroe[data-pop] .hv9d-ico { animation: hv5Pop .5s cubic-bezier(.34, 1.56, .64, 1); }
html[data-habitat-v3] .hv9d-vars { display: flex; justify-content: center; gap: 6px; position: relative; flex-wrap: wrap; }
html[data-habitat-v3] .hv9d-modal-velo .hv9d-var { position: relative; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; flex: 0 0 auto; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
html[data-habitat-v3] .hv9d-modal-velo .hv9d-var:active { transform: scale(.92); }
html[data-habitat-v3] .hv9d-var .bola {
  width: 30px; height: 30px; border-radius: 999px; background: radial-gradient(circle at 35% 30%, var(--m2), var(--m1) 70%);
  box-shadow: 0 0 0 2px var(--rc), 0 2px 6px rgba(0, 0, 0, .6);
}
html[data-habitat-v3] .hv9d-var[aria-pressed="true"] .bola { box-shadow: 0 0 0 2px #0b0b10, 0 0 0 4px #fff, 0 0 12px color-mix(in srgb, var(--rc) 70%, transparent); }
html[data-habitat-v3] .hv9d-var .ok {
  position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 999px; background: #0b0b10; border: 1px solid #7cffb2; color: #7cffb2;
  font-size: 10px; font-weight: 900; line-height: 14px; text-align: center;
}
html[data-habitat-v3] .hv9d-modal-velo .hv5-btn .hv4-rayo { width: 16px; height: 16px; font-size: 12px; }
html[data-habitat-v3] .hv9d-modal-velo .hv9d-modal > * { flex-shrink: 0; }   /* con los colores el modal pasa del alto: se desplaza, no aplasta los botones de 44 */
/* ── Aislamiento de skins: power-skins.css, power-energy.css y skin-*.css visten «.pf-section button» con !important (fondo, borde,
 * halo, clip-path, transform, filter y ::before/::after). La tienda conserva el arte de la lámina: guarda de 4 ids (le gana a los 2 de
 * bubble y a los 3 de deco-tienda.css) + !important. Las skins no se tocan. ── */
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button {
  clip-path: none !important; animation: none !important; text-shadow: none !important; filter: none !important; backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important; transform: none !important; translate: none !important; scale: none !important; position: relative !important;
  left: auto !important; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1) !important;
}
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button::before,
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button::after { content: none !important; display: none !important; }
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 .hv9d-filtros button {
  background: #101016 !important; border: 1px solid rgba(255, 255, 255, .08) !important; box-shadow: none !important; border-radius: 999px !important; overflow: visible !important; color: #a9adbd !important;
}
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 .hv9d-filtros button[aria-pressed="true"] { background: #fff !important; border-color: #fff !important; color: #0b0b10 !important; }
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 .hv9d-filtros button::after {
  content: "" !important; display: block !important; position: absolute !important; left: 0 !important; right: 0 !important; top: -1px !important; bottom: -11px !important;
  width: auto !important; height: auto !important; background: none !important; border: 0 !important; box-shadow: none !important; opacity: 1 !important; transform: none !important; animation: none !important;
}
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta {
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rc) 22%, #16161d), #0b0b10 72%) !important;
  border: 1.5px solid color-mix(in srgb, var(--rc) 60%, transparent) !important; box-shadow: none !important; border-radius: 18px !important; overflow: hidden !important;
}
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta:active { transform: scale(.97) !important; }
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta.r-legendaria::after,
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta.r-power::after {
  content: "" !important; display: block !important; position: absolute !important; inset: 0 !important; width: auto !important; height: auto !important; border: 0 !important;
  border-radius: 0 !important; box-shadow: none !important; opacity: 1 !important; pointer-events: none !important;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .12) 45%, transparent 60%) !important;
  transform: translateX(-100%); animation: hv9dBarre 3.2s cubic-bezier(.16, 1, .3, 1) infinite !important;
}
html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta.r-power::before {
  content: "" !important; display: block !important; position: absolute !important; inset: -1.5px !important; width: auto !important; height: auto !important;
  border-radius: 18px !important; border: 1.5px solid #ff8a96 !important; background: none !important; box-shadow: none !important; opacity: 0; pointer-events: none !important;
  transform: none !important; animation: hv9dPulso 2.4s steps(2) infinite !important;
}
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .hv9d-spr > i[data-n], html[data-habitat-v3] .hv9d-carta::after, html[data-habitat-v3] .hv9d-carta::before,
  html[data-habitat-v3] .hv9d-modal-velo .rayos, html[data-habitat-v3] .hv9d-modal-velo .heroe[data-pop] .hv9d-spr { animation: none; }
  html[data-habitat-v3] .hv9d-tienda .hv9d-carta, html[data-habitat-v3] .hv9d-modal-velo .hv9d-var { transition: none; }
  html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta::after,
  html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button.hv9d-carta::before { animation: none !important; }
  html:not(#hv9d-a):not(#hv9d-b):not(#hv9d-c):not(#hv9d-d)[data-habitat-v3] body #deco-tienda-v3 button { transition: none !important; }
}
/* ══ HÁBITAT v3 (H9 · fashion lab) · FASHION LAB, el probador (solo con html[data-habitat-v3]; companion fuente 43) ══
 * Lámina 15 de rediseno-v2 y tools/habitat_ref/proto/estilos.css (.cab .sub .saldos .pill .fa-vista .ped .heroe .lado .filtros .fa-grid
 * .fa-it .rec .n .titulo-sec), valores literales. Capa propia en body (#hv9f-capa, como el selector H9): las reglas de skin de
 * «.pf-section button» no la alcanzan. La confirmación de compra usa el diálogo de la Pulpería (.hv5-modal-velo · .hv5-modal · .hv5-btn,
 * H5). Cambios declarados: la entrada de la capa y el salto del pedestal con las curvas oficiales (el prototipo no anima), el pedestal
 * suma un halo cian de 14 px, y la cinta EN EL TALLER marca una Fashion 3D sin arte publicado. Lienzos a escala entera (×2 de la
 * celda) y pixelated. Solo transform y opacity se animan. */
html[data-habitat-v3] .hv9f-capa {
  --bg: #07070a; --linea: rgba(255, 255, 255, .08); --linea2: rgba(255, 255, 255, .14); --txt: #f4f4f6; --txt2: #a9adbd; --txt3: #6b7080;
  --rojo: #e8263a; --neon: #ff2a4a; --cian: #22d3ee; --oro: #fbbf24;
  --r-comun: #8b93a7; --r-rara: #3b82f6; --r-epica: #a855f7; --r-legendaria: #f59e0b; --r-power: #ff2a4a;
  position: fixed; inset: 0; z-index: 245; background: var(--bg); color: var(--txt); font-family: 'Rajdhani', sans-serif; font-weight: 500; letter-spacing: 0; line-height: normal;
  text-transform: none; text-align: left; -webkit-font-smoothing: antialiased; opacity: 0; transform: translateY(12px);
  transition: opacity .32s cubic-bezier(.16, 1, .3, 1), transform .32s cubic-bezier(.16, 1, .3, 1);
}
html[data-habitat-v3] .hv9f-capa[hidden] { display: none; }
html[data-habitat-v3] .hv9f-capa:focus { outline: none; }
html[data-habitat-v3] .hv9f-capa[data-estado="on"] { opacity: 1; transform: none; }   /* none, no translateY(0): sin capa compuesta el texto conserva el suavizado subpíxel */
html[data-habitat-v3] .hv9f-capa *, html[data-habitat-v3] .hv9f-capa *::before, html[data-habitat-v3] .hv9f-capa *::after { box-sizing: border-box; margin: 0; }   /* sin padding: 0 (le ganaría a la píldora .hv4-pill, misma especificidad y después) */
html[data-habitat-v3] .hv9f-capa button {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer; min-width: 0; min-height: 0; -webkit-tap-highlight-color: transparent;
  text-transform: none; letter-spacing: inherit; box-shadow: none; text-shadow: none;
  font-family: inherit !important;   /* power-ui.css: .power-hud button { font-family: sistema !important } */
}
html[data-habitat-v3] .hv9f-capa button:focus-visible { outline: 2px solid #ff2a4a; outline-offset: 2px; }
html[data-habitat-v3] .hv9f-capa canvas, html[data-habitat-v3] .hv9f-modal-velo canvas { display: block; image-rendering: crisp-edges; image-rendering: pixelated; }
html[data-habitat-v3] .hv9f-capa img { image-rendering: crisp-edges; image-rendering: pixelated; }
html[data-habitat-v3] .hv9f-capa .r-comun, html[data-habitat-v3] .hv9f-modal-velo .r-comun { --rc: var(--r-comun); }
html[data-habitat-v3] .hv9f-capa .r-rara, html[data-habitat-v3] .hv9f-modal-velo .r-rara { --rc: var(--r-rara); }
html[data-habitat-v3] .hv9f-capa .r-epica, html[data-habitat-v3] .hv9f-modal-velo .r-epica { --rc: var(--r-epica); }
html[data-habitat-v3] .hv9f-capa .r-legendaria, html[data-habitat-v3] .hv9f-modal-velo .r-legendaria { --rc: var(--r-legendaria); }
html[data-habitat-v3] .hv9f-capa .r-power, html[data-habitat-v3] .hv9f-modal-velo .r-power { --rc: var(--r-power); }
html[data-habitat-v3] .hv9f-pantalla {
  position: absolute; inset: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 14px 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none; background: var(--bg);   /* fondo opaco: el desplazamiento compuesto conserva el texto con suavizado subpíxel */
}
html[data-habitat-v3] .hv9f-pantalla::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv9f-lab { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; min-width: 0; margin: 0 auto; }
html[data-habitat-v3] .hv9f-lab > * { min-width: 0; flex: 0 0 auto; }
/* Cabecera (prototipo .cab) con la píldora única (.hv4-pill, 28 px) y cerrar de 44 */
html[data-habitat-v3] .hv9f-cab { display: flex; align-items: center; gap: 10px; min-width: 0; }
html[data-habitat-v3] .hv9f-cab > img { width: 32px; height: 32px; flex: 0 0 auto; }
html[data-habitat-v3] .hv9f-cab-t { min-width: 0; }
html[data-habitat-v3] .hv9f-cab .sub { font-size: 11px; color: var(--txt3); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
html[data-habitat-v3] .hv9f-cab h1 { font-family: 'Orbitron', sans-serif; font-size: 13px; letter-spacing: .18em; font-weight: 800; color: var(--txt); line-height: normal; white-space: nowrap; }
html[data-habitat-v3] .hv9f-cab .hv4-pill { color: var(--txt); }
html[data-habitat-v3] .hv9f-capa .hv9f-cerrar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: rgba(0, 0, 0, .5); border: 1px solid var(--linea2); font-size: 18px; }
/* Vista: el pedestal cian (prototipo .fa-vista .ped .heroe .lado) */
html[data-habitat-v3] .hv9f-vista {
  position: relative; height: 280px; border-radius: 24px; overflow: hidden; border: 1px solid var(--linea);
  background: radial-gradient(ellipse at 50% 90%, rgba(34, 211, 238, .18), transparent 55%), linear-gradient(180deg, #14141c, #08080c);
}
html[data-habitat-v3] .hv9f-vista .ped {
  position: absolute; left: 50%; bottom: 18px; width: 170px; height: 36px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, #23232d, #0e0e14 62%, transparent 64%); box-shadow: 0 0 0 2px rgba(34, 211, 238, .35), 0 0 14px rgba(34, 211, 238, .22);
}
html[data-habitat-v3] .hv9f-vista .heroe { position: absolute; left: 50%; bottom: 24px; width: 192px; height: 192px; margin-left: -96px; }
html[data-habitat-v3] .hv9f-vista .heroe canvas { position: absolute; left: -32px; top: -64px; width: 256px; height: 256px; max-width: none; max-height: none; transform-origin: 50% 100%; }
html[data-habitat-v3] .hv9f-vista .heroe[data-pop="a"] canvas { animation: hv9fPopA .5s cubic-bezier(.34, 1.56, .64, 1); }
html[data-habitat-v3] .hv9f-vista .heroe[data-pop="b"] canvas { animation: hv9fPopB .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes hv9fPopA {
  0% { transform: scale(1); } 40% { transform: scale(1.06) translateY(-6px); } 100% { transform: scale(1); }
}
@keyframes hv9fPopB {
  0% { transform: scale(1); } 40% { transform: scale(1.06) translateY(-6px); } 100% { transform: scale(1); }
}
html[data-habitat-v3] .hv9f-vista .lado { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
html[data-habitat-v3] .hv9f-capa .hv9f-vista .lado button {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(0, 0, 0, .5); border: 1px solid var(--linea2); font-size: 16px; display: grid; place-items: center;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv9f-capa .hv9f-vista .lado button:active { transform: scale(.92); }
html[data-habitat-v3] .hv9f-aviso {
  padding: 8px 12px; border-radius: 12px; background: #2a0a10; border: 1px solid rgba(232, 38, 58, .7); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2;
}
html[data-habitat-v3] .hv9f-aviso[hidden] { display: none; }
/* Filtros por slot (prototipo .filtros): chips de 34 px, el activo blanco; área de 44 por un ::after */
html[data-habitat-v3] .hv9f-filtros { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; margin-bottom: -10px; }
html[data-habitat-v3] .hv9f-filtros::-webkit-scrollbar { display: none; }
html[data-habitat-v3] .hv9f-capa .hv9f-filtros button {
  position: relative; flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 999px; background: #101016; border: 1px solid var(--linea);
  font-weight: 700; font-size: 13px; color: var(--txt2); white-space: nowrap;
}
html[data-habitat-v3] .hv9f-capa .hv9f-filtros button::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; bottom: -11px; }   /* 34 + 10 = 44 px */
html[data-habitat-v3] .hv9f-capa .hv9f-filtros button[aria-pressed="true"] { background: #fff; color: #0b0b10; border-color: #fff; }
/* Cartas (prototipo .fa-grid .fa-it .rec .n .pill): 3 columnas, la prenda SOBRE tu mascota en un lienzo de 96 × 72 */
html[data-habitat-v3] .hv9f-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html[data-habitat-v3] .hv9f-capa .hv9f-it {
  position: relative; min-width: 0; min-height: 44px; border-radius: 16px; padding: 4px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 18%, #15151c), #0c0c11 70%); border: 1.5px solid color-mix(in srgb, var(--rc) 55%, transparent);
  text-align: center; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-habitat-v3] .hv9f-capa .hv9f-it:active { transform: scale(.97); }
html[data-habitat-v3] .hv9f-capa .hv9f-it[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cian); border-color: var(--cian); }
html[data-habitat-v3] .hv9f-it .rec { width: 96px; height: 72px; max-width: 100%; overflow: hidden; position: relative; flex: 0 0 auto; pointer-events: none; }
html[data-habitat-v3] .hv9f-it .rec canvas, html[data-habitat-v3] .hv9f-it .rec img { position: absolute; left: 0; top: 0; width: 96px; height: 72px; max-width: none; }
html[data-habitat-v3] .hv9f-it .n { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere; }
html[data-habitat-v3] .hv9f-it .hv4-pill { height: 22px; font-size: 10px; padding: 0 8px 0 4px; flex: 0 0 auto; }
html[data-habitat-v3] .hv9f-est {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; flex: 0 0 auto; white-space: nowrap;
  font-family: 'Orbitron', sans-serif; font-size: 8.5px; letter-spacing: .08em; font-weight: 800; color: #7cffb2; background: #0b0b10; border: 1px solid rgba(124, 255, 178, .45);
}
html[data-habitat-v3] .hv9f-est.is-puesta { color: #0b0b10; background: var(--cian); border-color: var(--cian); }
html[data-habitat-v3] .hv9f-est.is-tour { color: var(--txt2); border-color: var(--linea2); }
html[data-habitat-v3] .hv9f-it .cinta {
  position: absolute; left: 4px; top: 4px; z-index: 1; padding: 2px 5px; border-radius: 5px; background: rgba(0, 0, 0, .7); border: 1px solid var(--linea2);
  font-family: 'Orbitron', sans-serif; font-size: 7px; letter-spacing: .12em; font-weight: 800; color: var(--oro); pointer-events: none;
}
html[data-habitat-v3] .hv9f-lab .titulo-sec { font-family: 'Orbitron', sans-serif; font-size: 10px; letter-spacing: .18em; color: var(--txt3); font-weight: 800; line-height: normal; }
/* Confirmación de compra: el diálogo de la Pulpería (H5) con la carta a ×2 */
html[data-habitat-v3] .hv9f-modal .heroe canvas { width: 192px; height: 144px; }
html[data-habitat-v3] .hv9f-modal-velo .hv5-btn .hv4-rayo { width: 16px; height: 16px; font-size: 12px; }
html[data-habitat-v3] .hv9f-modal > * { flex-shrink: 0; }
html[data-habitat-v3] .hv9f-vista .hv5-mas { z-index: 2; }
/* Con el probador encima la página no se ve: sus animaciones se pausan y no se desplaza (lección §7.291, como el selector). */
html[data-habitat-v3][data-hv9f-abierto], html[data-habitat-v3][data-hv9f-abierto] body { overflow: hidden; }
html[data-habitat-v3][data-hv9f-abierto] body > :not(#hv9f-capa):not(#hv9f-modal-velo), html[data-habitat-v3][data-hv9f-abierto] body > :not(#hv9f-capa):not(#hv9f-modal-velo) *,
html[data-habitat-v3][data-hv9f-abierto] body > :not(#hv9f-capa):not(#hv9f-modal-velo) *::before,
html[data-habitat-v3][data-hv9f-abierto] body > :not(#hv9f-capa):not(#hv9f-modal-velo) *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .hv9f-capa, html[data-habitat-v3] .hv9f-capa .hv9f-it, html[data-habitat-v3] .hv9f-capa .hv9f-vista .lado button { transition: none; }
  html[data-habitat-v3] .hv9f-vista .heroe[data-pop] canvas { animation: none; }
}
/* v3 · prenda 3D bloqueada para la mascota activa (mascota × variante sin render fiel a la lámina): rótulo a lo ancho de la carta, sin reflow */
html[data-habitat-v3] .hv9f-it .cinta.is-nd { right: 4px; text-align: center; white-space: normal; line-height: 1.25; font-size: 6.5px; letter-spacing: .06em; color: #ffb4b4; }
html[data-habitat-v3] .hv9f-it[data-hv9f-nd] .rec { opacity: .7; }

/* ═══ H10 · CÁMARA v3 (orden de Dirección, 2026-11-12 23:02) ═══════════════════════════════════════════════
 * En pantalla completa el estudio base ya no es `contain`: PetStage (companion/motor/02) escribe en la caja
 * data-hab-cam="full-v|full-h" y --hab-cam-w/h/x/y (px enteros = la misma proyección que usa para la mascota, los
 * toques y el piso). Sin el atributo nada de esto aplica y todo queda como antes (tarjeta, widget).
 * Las capas estáticas del cuarto (pared, props, sombras, muebles) se pintan UNA vez al tamaño del cuarto y la cámara
 * las traslada con la propiedad `translate` (independiente de `transform`: no pisa el translate3d inline de los muebles).
 * Solo se mueve `translate` (compuesto, sin layout) y las medidas no cambian durante un paneo. */
html:not(#hcm-a):not(#hcm-b):not(#hcm-c) body #power-companion-box[data-hab-cam] {
  background-size: var(--hab-cam-w) var(--hab-cam-h) !important;
  background-position: var(--hab-cam-x) var(--hab-cam-y) !important;
  background-repeat: no-repeat !important;
  /* pixel art: el estudio base se estira ×4,2 (vertical) sin suavizado; image-rendering se hereda, así que a los hijos directos se les
     devuelve el valor de siempre con :where() (especificidad 0: cualquier regla propia de un componente sigue ganando). */
  image-rendering: pixelated;
}
:where(#power-companion-box[data-hab-cam] > *) { image-rendering: auto; }
html:not(#hcm-a):not(#hcm-b):not(#hcm-c) body #power-companion-box[data-hab-cam-capas] :is(canvas.pet-wall-props, #habitat-pared-cv, #pet-floor-shadow-canvas, #habitat-portal-cv, #habitat-giro-cv, #pfs-stickers-layer) {
  width: var(--hab-cam-w) !important;
  height: var(--hab-cam-h) !important;
  max-width: none !important;
  max-height: none !important;
  left: 0 !important;
  top: 0 !important;
  image-rendering: pixelated;
}
/* El `translate` de las capas lo escribe PetStage._capasCam (directo en cada elemento, solo si cambió): por herencia de variables cada cuadro del paneo
   recalculaba el estilo de todo el subárbol de la caja (p95 de 50 a 67 ms con CPU × 4). */
@property --hab-cam-x { syntax: '<length>'; inherits: false; initial-value: 0px; }
/* Franjas (el cuarto de la cámara vertical mide ~77,7 % del alto de la caja: lámina «COMPLETA · VERTICAL»). Medidas sobre la lámina: iguales arriba y
 * abajo (~11 % cada una), PLANAS y casi negras (#05030a), con corte duro, la de abajo vacía. Van ENCIMA de las capas del cuarto (lienzos de pared, props,
 * sombras, muebles, mascota y chispas: z ≤ 29; este ::after es el último hijo, así que gana al empate del #pet-deco-fx-canvas) y DEBAJO de los chevrones y
 * el giro (z 30), el HUD (37), los botones ⛶ y los globos: nada del cuarto se pinta sobre ellas. En ::after (perfil.html lo apaga con !important para el chasis, de ahí
 * la guarda de ids). Repone lo que ese ::after del chasis y .tv-glitch-room::after le heredarían: modo de mezcla, opacidad, borde, sombra, filtro, animación. */
/* Lo que es interfaz y no cuarto (botones ⛶ y ↑, globo, combo, mini-menú) pasa por encima de las franjas: en la lámina viven sobre ellas. */
html:not(#hcm-a):not(#hcm-b):not(#hcm-c) body #power-companion-box[data-hab-cam="full-v"] > :is(#pet-fullscreen-btn, #pet-travel-btn, #pet-speech, #pet-combo, #pet-tama-menu) { z-index: 41 !important; }
html:not(#hcm-a):not(#hcm-b):not(#hcm-c) body #power-companion-box[data-hab-cam="full-v"]::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important; top: 0 !important; right: auto !important; bottom: auto !important;
  width: 100% !important; height: 100% !important;
  z-index: 29 !important;
  pointer-events: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
  background: linear-gradient(to bottom,
    #05030a 0, #05030a var(--hab-cam-y),
    transparent var(--hab-cam-y), transparent calc(var(--hab-cam-y) + var(--hab-cam-h)),
    #05030a calc(var(--hab-cam-y) + var(--hab-cam-h)), #05030a 100%) !important;
}

/* ── Arcade · Premios v2 · P2 · pestaña PREMIOS de la Mochila (lámina 02, abajo a la izquierda). Solo existe con la bandera
 *    (mochila-premios.js). Colores por escalón: gris consumible, azul prestado, violeta pieza, oro exclusivo, rosa jackpot. ── */
html[data-habitat-v3] .mp-cuerpo { display: flex; flex-direction: column; gap: 8px; padding: 2px 16px 16px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
html[data-habitat-v3] .mp-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
html[data-habitat-v3] .mp-fila {
  --ec: #9aa3b2; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 8px 10px;
  border-radius: 14px; background: linear-gradient(180deg, #14141b, #0b0b10); border: 1px solid var(--linea2); box-shadow: inset 3px 0 0 var(--ec), 0 6px 14px rgba(0, 0, 0, .35);
}
html[data-habitat-v3] .mp-fila[data-esc="prestado"] { --ec: #3fa9ff; }
html[data-habitat-v3] .mp-fila[data-esc="pieza"] { --ec: #a56bff; }
html[data-habitat-v3] .mp-fila[data-esc="exclusivo"] { --ec: #ffb62e; }
html[data-habitat-v3] .mp-fila[data-esc="jackpot"] { --ec: #ff2f8f; }
html[data-habitat-v3] .mp-ico { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
html[data-habitat-v3] .mp-tx { flex: 1 1 120px; min-width: 0; }
html[data-habitat-v3] .mp-tx b { display: block; font-size: 14px; line-height: 1.15; font-weight: 700; color: var(--txt); overflow-wrap: anywhere; }
html[data-habitat-v3] .mp-tx small { display: block; font-size: 11px; color: var(--txt2); overflow-wrap: anywhere; }
html[data-habitat-v3] .mp-chip {
  flex: 0 0 auto; font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 5px 9px; border-radius: 8px;
  color: #ffd27a; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .35);
}
html[data-habitat-v3] .mp-chip[data-urg="1"] { color: #ff8b8b; background: rgba(232, 38, 58, .16); border-color: rgba(232, 38, 58, .5); }
html[data-habitat-v3] .mp-quedatela {
  flex: 1 0 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff;
  background: linear-gradient(180deg, #2f86d6, #1f5fa3); border: 1px solid rgba(63, 169, 255, .6); touch-action: manipulation; cursor: pointer;
  transition: transform .16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .16s cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-habitat-v3] .mp-quedatela:active { transform: scale(.96); }
html[data-habitat-v3] .mp-quedatela:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; }
html[data-habitat-v3] .mp-msg, html[data-habitat-v3] .mp-chispas {
  margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 12px; line-height: 1.35; color: var(--txt); background: #1a0b14; border: 1px solid rgba(255, 47, 143, .55);
}
html[data-habitat-v3] .mp-chispas { animation: mp-entra .34s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes mp-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html[data-habitat-v3] .pw-notif-acc { display: flex; flex-wrap: wrap; gap: 6px; }
@media (prefers-reduced-motion: reduce) {
  html[data-habitat-v3] .mp-chispas { animation: none; }
  html[data-habitat-v3] .mp-quedatela { transition: none; }
}
/* ── Arcade · Premios v2 · P3 · Mochila › PREMIOS como la lámina 02: ícono 48 del premio, aviso de la campana arriba ── */
html[data-habitat-v3] .mp-ico { width: 48px; height: 48px; }
html[data-habitat-v3] .mp-ico img { width: 40px; height: 40px; object-fit: contain; }   /* como la Silla huevo de la lámina 02 */
html[data-habitat-v3] .mp-aviso {
  display: flex; align-items: flex-start; gap: 8px; min-width: 0; margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 12px; line-height: 1.35; color: var(--txt);
  background: linear-gradient(180deg, rgba(232, 38, 58, .14), rgba(26, 11, 20, .92)); border: 1px solid rgba(255, 47, 143, .6); box-shadow: 0 0 14px rgba(255, 47, 143, .22);
}
html[data-habitat-v3] .mp-aviso > * { min-width: 0; }
html[data-habitat-v3] .mp-aviso b { color: #fff; }
html[data-habitat-v3] .mp-aviso em { font-style: normal; font-weight: 800; color: #3fe08a; }

/* ══ t-habitat-arreglos · un solo panel, VOLVER fijo, hábitats con COMPRAR/ALQUILAR y la Power Coin del dock ═══════════════════
 *  · .hv-moneda = el MISMO sprite que el dock (.hab-spr-moneda · dock_power_coin.png, tira de 8 cuadros de 32 px): se muestra el
 *    cuadro 0 en cualquier tamaño (--m). Antes la Pulpería metía la tira entera en un <img> de 20 px y salía deformada.
 *  · .hv-btn pri/sec = los botones de las otras tiendas (.hv5-btn: Orbitron 10 px, 44 de alto, rojo / vidrio).
 *  · .hv-volver = «‹ VOLVER AL HÁBITAT», primera fila fija de cada tienda o selector (habitat-paneles.js la monta).
 *  · Skin / Hábitat / Deco ya no se meten en el flujo (empujaban el cuarto y escondían el dock): hoja fija abajo con scroll interno. */
html:not(#hv-a):not(#hv-b):not(#hv-c) .hv-moneda {
  display: inline-block; flex: 0 0 auto; width: var(--m, 20px); height: var(--m, 20px); vertical-align: middle;
  background: url("../../public/assets/sprites/ui/hab/dock_power_coin.png") 0 0 / 800% 100% no-repeat; image-rendering: pixelated;
}
html:not(#hv-a):not(#hv-b):not(#hv-c) .hv4-pill .hv-moneda { --m: 20px; }
html:not(#hv-a):not(#hv-b):not(#hv-c) .hv5-hoja .hv5-cab .hv4-pill .hv-moneda { --m: 32px; }
html:not(#hv-a):not(#hv-b):not(#hv-c) .hv-btn .hv-moneda { --m: 20px; }
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-btn {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; font-family: 'Orbitron', sans-serif; font-size: 10px; letter-spacing: .14em; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; white-space: nowrap; cursor: pointer; margin: 0; line-height: normal;
  background: #14141b; border: 1px solid rgba(255, 255, 255, .14); color: #f4f4f6;
}
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-btn.pri { background: linear-gradient(180deg, #ff3b4f, #c81e30); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-hab-acc { display: flex; gap: 8px; width: 100%; margin: -2px 0 4px; flex: 0 0 auto; }
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-volver {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; width: calc(100% - 24px); max-width: 420px; height: 44px; margin: 4px auto 6px; padding: 0 14px;
  position: sticky; top: 0; z-index: 3; border-radius: 12px; background: #14141b; border: 1px solid rgba(255, 255, 255, .14); color: #f4f4f6;
  font-family: 'Orbitron', sans-serif; font-size: 10px; letter-spacing: .14em; font-weight: 800; line-height: normal; cursor: pointer;
}
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-volver:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }
/* Los modales no se estiran: alto máximo y scroll por dentro. */
html[data-habitat-v3] .hv5-modal, html[data-habitat-v3] .hv9d-modal, html[data-habitat-v3] .hv9f-modal { max-height: min(86vh, 680px); max-height: min(86dvh, 680px); overflow-y: auto; overscroll-behavior: contain; }
/* Skin, Hábitat y Deco: hoja fija abajo (fuera del flujo): el cuarto y el dock no cambian de tamaño ni saltan (CLS 0). */
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="decoracion"], [data-hud-slot="fondo"]) > .hud-panel:not(#hud-panel-companero):not([hidden]) {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 241; width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box;
  max-height: 70vh; max-height: 70dvh; overflow: hidden auto; overscroll-behavior: contain; border-radius: 26px 26px 0 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .6); display: block; z-index: 260;
  background: linear-gradient(180deg, #14141b 0%, #0b0b10 100%); border: 0; border-top: 1px solid rgba(255, 255, 255, .14); opacity: 1;   /* fondo opaco propio: nada de la página se transparenta */
}
/* …y el dock (con sus rótulos) se queda donde está, en lugar de esconderse. */
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="decoracion"], [data-hud-slot="fondo"]) .power-console-dock.hab-dock { display: grid; }
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="decoracion"], [data-hud-slot="fondo"]) #hud-panel-companero :is(.power-console-hints, .power-console-extras) { display: block; }
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-volver[hidden] { display: none; }
/* CUIDAR no tiene hoja: su VOLVER flota abajo, sobre el dock, mientras el arco / la bandeja están abiertos. */
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-volver.hv-volver-flota {
  position: fixed; top: auto; left: 50%; right: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 262;
  width: min(360px, calc(100% - 24px)); margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
html:not(#hv-a):not(#hv-b):not(#hv-c) body .hv-volver { background: #14141b; }
/* Con una hoja de Skin / Hábitat / Deco abierta, main.perfil-page suelta su will-change: transform (habitat-dock.css, «will-change: transform»): un ancestro con
 * will-change: transform vuelve su bloque contenedor a la hoja position: fixed, que quedaba posicionada contra el final de la página (fuera de la pantalla). */
html.hv-hoja-abierta:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h) body:not(.pet-fullscreen-lock) main.perfil-page { will-change: auto; }   /* la clase la pone hotbarActivateSlot (sin :has(), que iOS < 15.4 no entiende) */
/* Lista de hábitats en la hoja fija: una COLUMNA (no la tira horizontal de R225): cada tarjeta completa con su fila COMPRAR / ALQUILAR debajo; la hoja crece con el contenido
 * (tope 70dvh y scroll vertical de la hoja). Antes la fila COMPRAR era otro elemento de la tira, quedaba a la derecha y la tira recortaba el alto. */
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panel-fondo #habitat-catalog-list {
  flex-direction: column; flex-wrap: nowrap; overflow: visible; scroll-snap-type: none; touch-action: auto; gap: 6px; width: 100%;
}
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panel-fondo #habitat-catalog-list > .habitat-card { flex: 0 0 auto; width: 100%; }
html[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f) body #hud-panel-fondo #habitat-catalog-list > .hv-hab-acc { flex: 0 0 auto; width: 100%; margin: -2px 0 4px; }
.hv5-mon { display: inline-flex; align-items: center; }
html[data-habitat-v3] .hv5-hoja .hv5-cab .hv5-mon img { width: 32px; height: 32px; }
.hv-hab-mini { display: block; width: 100%; max-width: 280px; height: 150px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html[data-habitat-v3] .hv5-modal .acciones .hv-btn { flex: 1 1 0; }
/* ── Aislamiento de skins: «.pf-section button» (power-skins.css, power-energy.css, skin-*.css) pinta fondo, borde, halo, clip-path, transform y ::before/::after con !important.
 * COMPRAR / ALQUILAR / VOLVER dentro de la hoja conservan su arte (rojo primario / vidrio secundario) en cualquier skin: guarda de 4 ids + !important, como la Tienda Deco. ── */
html:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d)[data-habitat-v3] body :is(.hv-btn, .hv-volver:not(.hv-volver-flota)) {
  clip-path: none !important; animation: none !important; text-shadow: none !important; filter: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  transform: none !important; translate: none !important; scale: none !important; border-radius: 12px !important; font-family: 'Orbitron', sans-serif !important; letter-spacing: .14em !important;
  font-size: 10px !important; font-weight: 800 !important; text-transform: none !important; min-height: 44px; height: 44px !important;
  background: #14141b !important; border: 1px solid rgba(255, 255, 255, .14) !important; color: #f4f4f6 !important; box-shadow: none !important;
}
html:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d)[data-habitat-v3] body .hv-btn.pri { background: linear-gradient(180deg, #ff3b4f, #c81e30) !important; border-color: transparent !important; color: #fff !important; box-shadow: 0 6px 18px rgba(232, 38, 58, .35), inset 0 1px 0 rgba(255, 255, 255, .25) !important; }
html:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d)[data-habitat-v3] body .hv-btn:disabled { opacity: .55 !important; box-shadow: none !important; }
html:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d)[data-habitat-v3] body :is(.hv-btn, .hv-volver)::before, html:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d)[data-habitat-v3] body :is(.hv-btn, .hv-volver)::after { content: none !important; display: none !important; }

/* t-pulido-kley-2411 · 8 (Kley 24-11) · CUIDAR más chico, redondo y sin texto: se entiende por el ícono (el nombre queda en el
   aria-label). Botones de 46 px (44 de toque como mínimo), la cápsula también redonda. Íconos SVG nuevos (companion 37 · hv3Ico):
   juego «a» de trazo y «b» de dos tonos con el acento de la skin. Nada parpadea; la entrada es la de siempre (solo transform). */
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-rb,
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-btn.ptm-cap.ptm-redondo {
  width: 46px; min-width: 46px; max-width: 46px; height: 46px; min-height: 46px; padding: 0; gap: 0; border-radius: 50%;
  display: grid; place-items: center; color: #f4f4f6;
  background: radial-gradient(circle at 50% 35%, rgba(36, 36, 46, .92), rgba(13, 13, 18, .92));
  border: 1.5px solid color-mix(in srgb, var(--hud-accent, #ff2a4a) 45%, rgba(255, 255, 255, .14));
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-rb .ptm-txt,
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-cap.ptm-redondo .ptm-txt {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .hv3-ico {
  width: 24px; height: 24px; display: block; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .hv3-ico-b .r { fill: color-mix(in srgb, var(--hud-accent, #ff2a4a) 40%, transparent); }
html[data-habitat-v3] #power-companion-box #pet-tama-menu[data-arco] .ptm-cap.ptm-redondo[data-cap="dentro"] { border-color: rgba(255, 210, 120, .75); }

/* t-pulido-kley-2411 · 6 (Kley 24-11) · Sin las flechas de los lados del hábitat: la rotación con deslizar ya anda bien.
   (Guarda de 3 ids: gana a las reglas de skins y a la de perfil-fashion.css.) */
/* Ocultas a la vista y al dedo, pero con Tab siguen llegando: al tener el foco del teclado aparecen (sin flechas no habría cómo girar con teclado). */
html:not(#pk-a):not(#pk-b):not(#pk-c) body #power-companion-box .hab-flecha:not(:focus-visible) { width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; opacity: 0 !important; pointer-events: none !important; }

/* t-pulido-kley-2411 · 7 · Pantalla completa: más chico y con el círculo más transparente. El área de toque sigue en 44 px; lo
   que se ve es un círculo de 34 px de cristal tenue con un aro fino. (4 ids: gana a la guarda de 3 de perfil.html §7.290.) */
html:not(#pk-a):not(#pk-b):not(#pk-c):not(#pk-d) body #power-companion-box #pet-fullscreen-btn.pet-fullscreen-btn {
  width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  background: radial-gradient(circle, rgba(10, 10, 14, 0.26) 0 16px, rgba(244, 233, 208, 0.22) 16px 17px, transparent 17.5px) !important;
  border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  font-size: 0.78rem !important; opacity: 0.85;
}
html:not(#pk-a):not(#pk-b):not(#pk-c):not(#pk-d) body #power-companion-box #pet-fullscreen-btn.pet-fullscreen-btn svg { width: 15px; height: 15px; }

/* ═══ A39 · t-perfil-urgente (Kley 25-11, con video) · LAS HOJAS DE SKIN, HÁBITAT Y DECO, A PANTALLA COMPLETA Y ENCIMA DE TODO ═══
 * Causa (fase 1): la hoja es position: fixed, pero vive dentro de #hud-panels-area < #personalizacion-hotbar-section (.pf-section)
 * < main.perfil-page. Una skin que le pone clip-path a .pf-section (Steel y Cobalto: corte en diagonal) RECORTA también a sus hijos
 * fijos: la hoja quedaba del tamaño de la sección de la hotbar y por el hueco se veía el perfil (la tarjeta ENERGÍA, la de
 * identidad). Lo mismo pasa con transform, filter, will-change, contain o un z-index en cualquiera de esos padres (la hoja,
 * con su z 260, quedaba atrapada en el z 1 de main y del área). Con una hoja abierta (html.hv-hoja-abierta, la pone
 * hotbarActivateSlot), esos padres sueltan TODO lo que encierra a un hijo fijo, sea cual sea la skin; y en Skin y Hábitat
 * (html.hv-hoja-completa) la hoja ocupa la pantalla entera, opaca, encima de la cabecera y de la franja (z 240: debajo de las fichas de la Estación, 244–247, y de los
 * modales del hábitat, 250+). Al cerrarse, la clase se va y todo vuelve a ser como antes. */
html.hv-hoja-abierta:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body:is(*, .power-hud),
html.hv-hoja-abierta:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body main.perfil-page,
html.hv-hoja-abierta:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #personalizacion-hotbar-section,
html.hv-hoja-abierta:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area {
  clip-path: none !important; -webkit-clip-path: none !important; mask: none !important; -webkit-mask: none !important;
  transform: none !important; filter: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  perspective: none !important; will-change: auto !important; contain: none !important; container-type: normal !important;
  z-index: auto !important; isolation: auto !important;
}
html.hv-hoja-completa[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="fondo"]) > .hud-panel:not(#hud-panel-companero):not([hidden]) {
  position: fixed !important; inset: 0 !important; top: 0 !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
  width: 100% !important; max-width: none !important; height: 100vh !important; height: 100dvh !important; max-height: none !important; margin: 0 !important;
  z-index: 240 !important; border-radius: 0 !important; border: 0 !important; clip-path: none !important; opacity: 1 !important;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  background: #0b0b10 !important; background-image: linear-gradient(180deg, #14141b 0%, #0b0b10 100%) !important;
  overflow: hidden auto !important; overscroll-behavior: contain; box-shadow: none !important; transform: none !important; animation: none !important;
}
/* Deco (la hoja de abajo de la ranura DECO: lista rápida, PROBAR, colocar) sigue siendo hoja de abajo, con el cuarto a la vista; suelta
 * los encierres como las otras y queda en z 240: debajo de los modales de compra (250+) y de las fichas de la Estación (244–247). */
html.hv-hoja-abierta[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area:is([data-hud-slot="skin"], [data-hud-slot="decoracion"], [data-hud-slot="fondo"]) > .hud-panel:not(#hud-panel-companero):not([hidden]) { z-index: 240 !important; }
/* Dentro de la hoja a pantalla completa, el contenido usa el ancho del teléfono, centrado en pantallas grandes. */
html.hv-hoja-completa[data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area > .hud-panel:not(#hud-panel-companero):not([hidden]) > .hud-panel-inner {
  max-width: 760px; margin: 0 auto;
}
/* Con la hoja a pantalla completa, lo de abajo no se pinta (visibility): no se transparenta nunca y el teléfono no gasta GPU en el perfil
 * tapado (el hábitat con la mascota, la tarjeta, la batería). La hoja vive dentro de la sección de la hotbar: se ocultan sus hermanos. */
html.hv-hoja-completa[data-habitat-v3][data-pf-cmd="propio"]:not([data-se-probando]):not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body main.perfil-page > :not(#personalizacion-hotbar-section),
html.hv-hoja-completa[data-habitat-v3][data-pf-cmd="propio"]:not([data-se-probando]):not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #personalizacion-hotbar-section > :not(#hud-panels-area),
html.hv-hoja-completa[data-habitat-v3][data-pf-cmd="propio"]:not([data-se-probando]):not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area > #hud-panel-companero {
  visibility: hidden !important;
}
/* PROBAR una skin (Estación de carga, 30 s): la hoja vuelve a ser una hoja abajo para ver el perfil con la skin probada arriba. */
html.hv-hoja-completa[data-se-probando][data-habitat-v3][data-pf-cmd="propio"]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body #hud-panels-area[data-hud-slot="skin"] > #hud-panel-skin:not([hidden]) {
  top: auto !important; height: auto !important; max-height: 62vh !important; max-height: 62dvh !important; border-radius: 26px 26px 0 0 !important;
  border-top: 1px solid rgba(255, 255, 255, .14) !important; box-shadow: 0 -20px 50px rgba(0, 0, 0, .6) !important;
}
/* POWER HOME (pantalla completa propia, en body): mientras está abierto, el perfil de abajo no se pinta. */
html[data-ph-abierta]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body main.perfil-page { visibility: hidden !important; }
/* GASTAR (POWER COINS), Mochila y Pulpería son hojas desde abajo con velo propio (en body). A39: el velo deja de ser translúcido (antes
 * rgba 0,0,0,.55: el perfil se adivinaba detrás, que es justo lo que Kley no quiere ver): fondo opaco del mismo tono que las hojas.
 * Tocar el velo sigue cerrando la hoja. */
html[data-habitat-v3]:not(#hv-a):not(#hv-b):not(#hv-c):not(#hv-d):not(#hv-e):not(#hv-f):not(#hv-g):not(#hv-h):not(#hv-i) body :is(.hv4-velo, .pg-velo) {
  background: #07070a !important; background-image: radial-gradient(120% 60% at 50% 0%, #15151d 0%, #07070a 70%) !important;
}
