/* t-gastar · «GASTAR» de un toque (habitat-gastar.js). Lámina 03 de referencias-visuales/habitat/rediseno-v3 («los íconos
 * vivos»): fichas de obsidiana con remaches de latón en las esquinas y filete del acento abajo; tiras de ui/vivos en su cuadro 0,
 * a 48 px (escala entera, sin suavizar). Latón = los mismos tres tonos de arcade-maquinas.css (--am-laton*).
 * Reglas: 44 px declarados en la regla base (V-33), min-width: 0 y elipsis en los rótulos (V-34), solo transform y opacity con
 * las curvas oficiales (V-10), [hidden] = display none (V-43), cristal liso sin rejillas (V-41). Guarda de 3 ids (V-40); la hoja
 * vive en body (fuera de .pf-section); power-ui.css le pone la fuente del sistema a todo botón con !important, por eso la fuente
 * va con !important acá. El rayo es el glifo de TEXTO ⚡︎ (U+26A1 U+FE0E) en el rojo del acento, como .hab-cuenta i
 * (habitat-dock.css): nada de ámbar ni del emoji a color bajo Power (r64). Sin backdrop-filter (la poda R90
 * lo apaga en body.power-hud; LECCIONES «backdrop-filter sobre el lienzo vivo»): vidrio sólido al 90–96 % con bisel de latón. */
html:not(#pg-a):not(#pg-b):not(#pg-c) body {
  --pg-laton: #c9a24a; --pg-laton-l: #f3dc94; --pg-laton-o: #6b4a12;
}

/* ── El disparador del perfil: la ficha 1 POWER COINS del dock (#hud-tokens-self, role=button en perfil.html). Decisión de la
   DIRECTORA: sin botones sueltos fuera de la tarjeta (HABITAT.md §7.286) y sin emoji nuevo en el dock. La ficha ya mide 54–68 px;
   acá se declaran los 44 px de su área táctil y el foco. ── */
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hab-dock > #hud-tokens-self[role="button"] {
  min-width: 44px; min-height: 44px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hab-dock > #hud-tokens-self[role="button"]:active { transform: translate3d(0, 2px, 0) scale(0.97); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hab-dock > #hud-tokens-self[role="button"]:focus-visible { outline: 2px solid var(--power-accent, #ff3b30); outline-offset: 3px; }

/* ── Perfil AJENO (t-arreglos-kley-a): ni la ficha POWER COINS ni la hoja ni el velo se ven, aunque el dock del hábitat v3 les dé display.
   html[data-pf-cmd] lo fija el <head> de perfil.html antes del primer pintado. ── */
html[data-pf-cmd="ajeno"] body .hab-dock > #hud-tokens-self,
html[data-pf-cmd="ajeno"] body #hud-tokens-self,
html[data-pf-cmd="ajeno"] body .pg-hoja,
html[data-pf-cmd="ajeno"] body .pg-velo { display: none !important; }

/* ── La hoja: cristal obsidiana desde abajo, como la mochila (H4), con el bisel de latón arriba ── */
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-velo {
  position: fixed; inset: 0; z-index: 242; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-velo[data-on="1"] { opacity: 1; pointer-events: auto; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja {
  --txt: #f4f4f6; --txt2: #a9adbd;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 243; max-height: 86vh; max-height: 86dvh; display: flex; flex-direction: column;
  width: 100%; max-width: 560px; margin: 0 auto; padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
  border-radius: 26px 26px 0 0; border-top: 1px solid var(--pg-laton-o);
  background: linear-gradient(180deg, rgba(20, 20, 27, 0.96) 0%, rgba(11, 11, 16, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(243, 220, 148, 0.3), 0 -20px 50px rgba(0, 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 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja *, html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja *::before, html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja *::after { box-sizing: border-box; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja[hidden] { display: none; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja[data-estado="on"] { transform: translateY(0); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja button {
  font: inherit; font-family: inherit !important; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer;
  text-transform: none; letter-spacing: inherit; box-shadow: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja button:focus-visible { outline: 2px solid var(--power-accent, #ff2a4a); outline-offset: 2px; }
/* Asa: se ve de 5 px, toca en 44 (::after, sin sumar alto). */
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-asa { position: relative; display: block; flex: 0 0 auto; width: 44px; height: 5px; margin: 8px auto 6px; border-radius: 3px; background: #2a2a34; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-asa::after { content: ""; position: absolute; left: -10px; right: -10px; top: -20px; bottom: -19px; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-cab { display: flex; align-items: center; gap: 10px; padding: 4px 16px 2px; min-width: 0; flex: 0 0 auto; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-cab > * { min-width: 0; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-rayo { flex: 0 0 auto; color: var(--power-accent, #ff3b30); font-size: 20px; line-height: 1; font-variant-emoji: text; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-cab h2 { margin: 0; font: 800 13px/1.2 'Orbitron', sans-serif; letter-spacing: 0.18em; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-pill {
  margin-left: auto; flex: 0 1 auto; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 8px; border-radius: 999px;
  background: rgba(11, 11, 16, 0.9); border: 1px solid rgba(255, 255, 255, 0.14);
  font: 700 12px/1 'Orbitron', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-pill-r { color: var(--power-accent, #ff3b30); font-variant-emoji: text; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-sub { margin: 2px 16px 10px; font-size: 13px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-lista {
  display: flex; flex-direction: column; gap: 8px; padding: 0 16px 2px; min-width: 0; min-height: 0; flex: 1 1 auto;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-lista::-webkit-scrollbar { display: none; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-lista > * { flex: 0 0 auto; }

/* Cada acceso: ficha de obsidiana (lámina 03) con remaches de latón, filete del acento y el ícono vivo en su cuadro 0. */
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; min-width: 0; min-height: 44px; height: 64px; padding: 8px 12px 8px 10px; text-align: left;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(30, 30, 40, 0.9), rgba(10, 10, 14, 0.94));
  box-shadow: inset 0 1px 0 rgba(243, 220, 148, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc::before {
  content: ""; position: absolute; inset: 4px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 2px 2px, var(--pg-laton-l) 0 1px, var(--pg-laton) 1.4px, transparent 2.2px) 0 0 / 50% 100% no-repeat,
    radial-gradient(circle at calc(100% - 2px) 2px, var(--pg-laton-l) 0 1px, var(--pg-laton) 1.4px, transparent 2.2px) 100% 0 / 50% 100% no-repeat;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; pointer-events: none;
  background: var(--power-accent, #ff2a4a); opacity: 0.7;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc:active { transform: scale(0.97); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc > * { min-width: 0; pointer-events: none; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico {
  --n: 1; display: block; width: 48px; height: 48px;
  background-repeat: no-repeat; background-position: 0 0; background-size: calc(var(--n) * 100%) 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico[data-ico="skin"] { --n: 12; background-image: url("../../public/assets/sprites/ui/vivos/skin_power_icono.png"); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico[data-ico="habitat"] { --n: 1; background-image: url("../../public/assets/sprites/ui/vivos/habitat_diorama.png"); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico[data-ico="fashion"] { --n: 6; background-image: url("../../public/assets/sprites/ui/vivos/fashion_a_camerino.png"); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico[data-ico="deco"] { --n: 8; background-image: url("../../public/assets/sprites/ui/vivos/deco_negra.png"); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico[data-ico="pulperia"] { --n: 6; background-image: url("../../public/assets/sprites/ui/vivos/pulperia_a_icono.png"); }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-tx b { font: 800 12px/1.2 'Orbitron', sans-serif; letter-spacing: 0.14em; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-tx small { font-size: 13px; line-height: 1.15; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-flecha { font-size: 22px; line-height: 1; color: var(--txt2); }

/* ── Skins: Cyber Pulse = cristal liso, borde neón de 1 px y halo de 14 px (sin rejillas, V-41); Bubblegum = el rosa del dock ── */
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="cyan"] body .pg-hoja .pg-acc {
  background: var(--cp-especular, none), var(--cp-vidrio, rgba(6, 10, 18, 0.9));
  border-color: rgba(var(--cp-cian, 34, 211, 238), 0.5);
  box-shadow: inset 0 1px 0 rgba(236, 254, 255, 0.2), 0 0 14px rgba(var(--cp-cian, 34, 211, 238), 0.3);
}
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="cyan"] body .pg-hoja {
  background: var(--cp-especular, none), var(--cp-vidrio, rgba(6, 10, 18, 0.9));
  border-top-color: rgba(var(--cp-cian, 34, 211, 238), 0.5);
  box-shadow: inset 0 1px 0 rgba(236, 254, 255, 0.2), 0 0 14px rgba(var(--cp-cian, 34, 211, 238), 0.3);
}
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="cyan"] body .pg-hoja .pg-acc::before { display: none; }
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="bubble"] body .pg-hoja .pg-acc {
  border-color: rgba(255, 140, 220, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 230, 250, 0.22), 0 0 14px rgba(255, 90, 200, 0.26);
}
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="bubble"] body .pg-hoja { border-top-color: rgba(255, 140, 220, 0.42); }

/* ── Teléfono acostado (844×390): la hoja no pasa del 86 % del alto. Sin la bajada, accesos de 44 px con el ícono a 24 (la mitad
   exacta del arte de 48) y la lista se desliza si aún faltara lugar: los 5 se alcanzan siempre. ── */
@media (max-height: 480px) {
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-sub { display: none; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-asa { margin: 6px auto 4px; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-cab { padding-bottom: 8px; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-lista { gap: 6px; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc { height: 44px; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 4px 12px 4px 10px; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-ico { width: 24px; height: 24px; }
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-tx { flex-direction: row; align-items: baseline; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-velo,
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja, html:not(#pg-a):not(#pg-b):not(#pg-c) body .pg-hoja .pg-acc { transition: none; }
}

/* ── En la mochila vacía (habitat-mochila.js): «IR A …» y «GASTAR» en una fila; GASTAR con el cristal y el latón del perfil ── */
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir { display: flex; gap: 8px; min-width: 0; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir > .hv4-btn { flex: 1 1 auto; width: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir > .hv4-btn.hv4-btn-gastar {
  flex: 0 0 auto; min-height: 44px; height: 44px; padding: 0 14px; gap: 6px; color: #f4f4f6;
  border: 1px solid var(--pg-laton-o);
  background: linear-gradient(160deg, rgba(28, 28, 36, 0.9), rgba(8, 8, 12, 0.96));
  box-shadow: inset 0 1px 0 rgba(243, 220, 148, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px #000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir > .hv4-btn.hv4-btn-gastar > .hv4-gastar-r { color: var(--power-accent, #ff3b30); font-size: 14px; letter-spacing: 0; font-variant-emoji: text; }
html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir > .hv4-btn.hv4-btn-gastar:active { transform: scale(0.97); }
html:not(#pg-a):not(#pg-b):not(#pg-c)[data-power-accent="cyan"] body .hv4-hoja .hv4-ir > .hv4-btn.hv4-btn-gastar {
  background: var(--cp-especular, none), var(--cp-vidrio, rgba(6, 10, 18, 0.9));
  border-color: rgba(var(--cp-cian, 34, 211, 238), 0.5);
  box-shadow: inset 0 1px 0 rgba(236, 254, 255, 0.2), 0 0 14px rgba(var(--cp-cian, 34, 211, 238), 0.3);
}
@media (prefers-reduced-motion: reduce) {
  html:not(#pg-a):not(#pg-b):not(#pg-c) body .hv4-hoja .hv4-ir > .hv4-btn.hv4-btn-gastar { transition: none; }
}
