/* Pixambas v133 — Lienzo profesional tipo Aseprite/Magma/Photopea + Desplegables limpios + Botones estilo Código/Borrar. */

/* Botones tintados modernos unificados (estilo </> Código y 🗑 Borrar) */
.px-tint-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  height:32px;min-height:32px;padding:0 11px;border-radius:9px;
  border:1px solid color-mix(in srgb,#6355e8 42%,var(--ui-border,#ccc));
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 13%,var(--ui-surface,#fff)),color-mix(in srgb,#0ea5e9 11%,var(--ui-surface,#fff)));
  color:var(--ui-accent-strong,#4435c2);font-size:12px;font-weight:800;white-space:nowrap;cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.px-tint-btn:hover,.px-tint-btn[aria-expanded="true"],.px-tint-btn.on{
  background:linear-gradient(135deg,#6355e8,#0ea5e9);color:#fff!important;border-color:transparent;
  box-shadow:0 4px 14px rgba(99,85,232,.30);
}
.px-tint-pink{
  border-color:color-mix(in srgb,#ec4899 42%,var(--ui-border,#ccc));
  background:linear-gradient(135deg,color-mix(in srgb,#ec4899 12%,var(--ui-surface,#fff)),color-mix(in srgb,#6355e8 11%,var(--ui-surface,#fff)));
  color:#be185d;
}
:root[data-theme="dark"] .px-tint-pink{color:#f9a8d4}
.px-tint-pink:hover,.px-tint-pink.on{
  background:linear-gradient(135deg,#ec4899,#6355e8);color:#fff!important;border-color:transparent;
  box-shadow:0 4px 14px rgba(236,72,153,.28);
}

/* Barra superior desplegable limpia en Pixel Art (#opts reorganizado en popovers) */
body.studio-v2.pixel-page #opts.px-opts-modern{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  flex-wrap:nowrap!important;gap:8px!important;min-height:44px!important;height:auto!important;
  padding:5px 10px!important;border-radius:12px!important;
  background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;
  overflow:visible!important;position:relative;z-index:55;
}
body.studio-v2.pixel-page #opts.px-opts-modern .opts-group[hidden]{display:none!important}
body.studio-v2.pixel-page.studio-focus #opts.px-opts-modern{display:none!important}
.px-opts-left,.px-opts-right{display:flex;align-items:center;gap:7px;flex-wrap:nowrap;min-width:0}
.px-pop{position:relative;flex:0 0 auto}
.px-pop>summary{
  list-style:none;display:inline-flex;align-items:center;gap:6px;
  height:32px;min-height:32px;padding:0 12px;border-radius:9px;cursor:pointer;
  border:1px solid color-mix(in srgb,#6355e8 42%,var(--ui-border));
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 13%,var(--ui-surface)),color-mix(in srgb,#0ea5e9 10%,var(--ui-surface)));
  color:var(--ui-accent-strong,#4435c2);font-size:12px;font-weight:800;white-space:nowrap;
  user-select:none;transition:background .14s ease,color .14s ease;
}
.px-pop>summary::-webkit-details-marker{display:none}
.px-pop[open]>summary,.px-pop>summary:hover{
  background:linear-gradient(135deg,#6355e8,#4f46e5);color:#fff;border-color:transparent;
  box-shadow:0 4px 12px rgba(99,85,232,.26);
}
.px-pop-dot{
  width:7px;height:7px;border-radius:50%;background:#ec4899;display:inline-block;
  box-shadow:0 0 0 2px rgba(255,255,255,.7);
}
.px-pop-dot[hidden]{display:none!important}
.px-pop-panel{
  position:fixed;top:106px;left:12px;z-index:2600;
  width:min(300px,calc(100vw - 20px));padding:12px;border-radius:14px;
  background:var(--ui-surface);border:1px solid var(--ui-border-strong);
  box-shadow:0 18px 46px rgba(15,18,44,.22);
  display:flex;flex-direction:column;gap:10px;
}
.px-pop:not([open])>.px-pop-panel{display:none}
.px-pop-title{
  font-size:10.5px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ui-muted);margin:0;
}
.px-sym-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.px-sym-grid button{
  min-height:34px;height:34px;border-radius:9px;font-size:12px;font-weight:750;
  border:1px solid var(--ui-border-strong);background:var(--ui-surface-2);color:var(--ui-text);
}
.px-sym-grid button.on{
  background:linear-gradient(135deg,#6355e8,#4f46e5);color:#fff!important;border-color:transparent;
}
.px-pop-panel .px-tool-ctx{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;margin:0!important}
.px-pop-panel .px-ctx-chip{
  width:100%!important;justify-content:flex-start!important;min-height:36px!important;height:auto!important;
  padding:7px 10px!important;border-radius:9px!important;font-size:12.5px!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack{display:flex;flex-direction:column;gap:6px}
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack button,
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack #gridb,
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack #tileb{
  width:100%!important;min-width:0!important;max-width:none!important;min-height:36px!important;height:36px!important;justify-content:flex-start!important;
  padding:0 11px!important;border-radius:9px!important;font-size:12.5px!important;font-weight:750!important;
  border:1px solid var(--ui-border-strong)!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack button.on,
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack #gridb.on,
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel .px-view-stack #tileb.on{
  background:linear-gradient(135deg,#6355e8,#4f46e5)!important;color:#fff!important;border-color:transparent!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel #txo:not([hidden]){
  display:flex!important;flex-direction:column!important;gap:6px!important;align-items:stretch!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern .px-pop-panel #txo label{
  display:flex!important;justify-content:space-between!important;align-items:center!important;gap:8px!important;width:100%!important;
}

/* Botones de sprites en la derecha de #opts con estilo </> Código */
body.studio-v2.pixel-page #opts.px-opts-modern #sprite-tester-open{
  height:32px!important;min-height:32px!important;padding:0 12px!important;border-radius:9px!important;
  border:1px solid color-mix(in srgb,#6355e8 48%,var(--ui-border))!important;
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 15%,var(--ui-surface)),color-mix(in srgb,#0ea5e9 14%,var(--ui-surface)))!important;
  color:var(--ui-accent-strong,#4435c2)!important;font-size:12px!important;font-weight:800!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern #sprite-tester-open:hover{
  background:linear-gradient(135deg,#6355e8,#0ea5e9)!important;color:#fff!important;border-color:transparent!important;
}
body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open{
  height:32px!important;min-height:32px!important;padding:0 11px!important;border-radius:9px!important;
  border:1px solid color-mix(in srgb,#ec4899 38%,var(--ui-border))!important;
  background:linear-gradient(135deg,color-mix(in srgb,#ec4899 10%,var(--ui-surface)),var(--ui-surface))!important;
  color:#be185d!important;font-size:12px!important;font-weight:800!important;
}
:root[data-theme="dark"] body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open{color:#f9a8d4!important}
body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open:hover{
  background:linear-gradient(135deg,#ec4899,#6355e8)!important;color:#fff!important;border-color:transparent!important;
}

/* Cápsula flotante profesional del lienzo (tipo Magma / Photopea / Aseprite) */
.px-canvas-hud{
  position:absolute;right:12px;bottom:12px;z-index:48;
  display:inline-flex;align-items:center;gap:4px;padding:4px 5px;border-radius:12px;
  background:color-mix(in srgb,var(--ui-surface,#fff) 90%,transparent);
  border:1px solid var(--ui-border-strong,#c4cae0);
  box-shadow:0 8px 24px rgba(15,18,44,.16);backdrop-filter:blur(10px);
}
.px-canvas-hud button{
  height:28px!important;min-height:28px!important;padding:0 8px!important;border-radius:8px!important;
  border:1px solid var(--ui-border)!important;background:var(--ui-surface-2)!important;
  color:var(--ui-text)!important;font-size:12px!important;font-weight:800!important;
  display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:pointer;
}
.px-canvas-hud button:hover{border-color:#6355e8!important;color:var(--ui-accent-strong,#4f46e5)!important}
.px-canvas-hud .px-hud-icon{width:28px!important;min-width:28px!important;padding:0!important;font-size:14px!important}
.px-canvas-hud .px-hud-zoom{min-width:62px!important;font-variant-numeric:tabular-nums}
.px-canvas-hud .px-hud-fit{
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 14%,var(--ui-surface)),color-mix(in srgb,#0ea5e9 12%,var(--ui-surface)))!important;
  border-color:color-mix(in srgb,#6355e8 42%,var(--ui-border))!important;
  color:var(--ui-accent-strong,#4435c2)!important;
}
.px-zoom-pop{position:relative}
.px-zoom-menu{
  position:absolute;right:0;bottom:calc(100% + 8px);z-index:2600;
  width:228px;padding:8px;border-radius:13px;
  background:var(--ui-surface);border:1px solid var(--ui-border-strong);
  box-shadow:0 16px 42px rgba(15,18,44,.24);
  display:flex;flex-direction:column;gap:5px;
}
.px-zoom-menu[hidden]{display:none!important}
.px-zoom-menu button{
  width:100%!important;height:34px!important;min-height:34px!important;justify-content:flex-start!important;
  padding:0 10px!important;font-size:12px!important;font-weight:750!important;border-radius:8px!important;
}
.px-zoom-menu button.on{
  background:linear-gradient(135deg,#6355e8,#4f46e5)!important;color:#fff!important;border-color:transparent!important;
}

/* Micro-indicador de dimensiones y coordenadas (X, Y) abajo a la izquierda */
.px-canvas-meta{
  position:absolute;left:12px;bottom:12px;z-index:45;pointer-events:none;
  padding:4px 9px;border-radius:9px;
  background:color-mix(in srgb,var(--ui-surface,#fff) 84%,transparent);
  border:1px solid var(--ui-border);backdrop-filter:blur(8px);
  font-size:11px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--ui-muted);
}
.px-mirror-badge{
  position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:46;
  padding:4px 11px;border-radius:999px;font-size:11.5px;font-weight:800;cursor:pointer;
  background:linear-gradient(135deg,#ec4899,#6355e8);color:#fff;border:0;
  box-shadow:0 6px 18px rgba(99,85,232,.30);
}
.px-mirror-badge[hidden]{display:none!important}
.px-view-flipped #wrap canvas{transform:scaleX(-1)}

/* Pastilla flotante para salir de Modo Concentración (Pixel · Dibujo · 3D) */
.px-focus-exit{
  position:fixed;top:66px;left:50%;transform:translateX(-50%);z-index:2500;
  height:36px;padding:0 15px;border-radius:999px;border:1px solid color-mix(in srgb,#6355e8 50%,var(--ui-border,#ccc));
  background:linear-gradient(135deg,#6355e8,#0ea5e9);color:#fff!important;
  font-size:12.5px;font-weight:800;cursor:pointer;box-shadow:0 8px 24px rgba(99,85,232,.38);
  display:none;align-items:center;gap:6px;white-space:nowrap;
}
body.studio-focus .px-focus-exit,
body.s3-focus .px-focus-exit{display:inline-flex!important}

/* Botón visible Pantalla Completa en la barra superior (Pixel · Dibujo) */
body.studio-v2.editor-page .app-header #studio-canvas-expand{
  display:inline-flex!important;align-items:center;justify-content:center;gap:4px;
  height:36px!important;min-height:36px!important;width:36px!important;min-width:36px!important;padding:0!important;
  border-radius:10px!important;font-size:16px!important;font-weight:800!important;
  border:1px solid color-mix(in srgb,#6355e8 45%,var(--ui-border))!important;
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 14%,var(--ui-surface)),color-mix(in srgb,#0ea5e9 12%,var(--ui-surface)))!important;
  color:var(--ui-accent-strong,#4435c2)!important;
}
body.studio-v2.editor-page .app-header #studio-canvas-expand::before{display:none!important;content:none!important}
body.studio-v2.editor-page .app-header #studio-canvas-expand:hover,
body.studio-v2.editor-page.studio-canvas-fullscreen .app-header #studio-canvas-expand{
  background:linear-gradient(135deg,#6355e8,#0ea5e9)!important;color:#fff!important;border-color:transparent!important;
}

@media(max-width:640px){
  body.studio-v2.pixel-page #opts.px-opts-modern{padding:6px 8px!important;gap:6px!important;min-height:46px!important}
  .px-opts-left,.px-opts-right{gap:6px}
  .px-pop>summary{height:34px;min-height:34px;padding:0 9px;font-size:11.5px;gap:5px}
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open{
    width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;font-size:0!important;
  }
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open::before{content:'⚑';font-size:14px;line-height:1}
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-tester-open{height:34px!important;min-height:34px!important;padding:0 10px!important;font-size:11.5px!important}
  .px-canvas-meta{display:none!important}
  .px-canvas-hud{right:10px;bottom:12px;padding:4px 6px;gap:5px;border-radius:13px}
  .px-canvas-hud button{height:32px!important;min-height:32px!important}
  .px-canvas-hud .px-hud-icon{width:32px!important;min-width:32px!important}
  .px-focus-exit{top:60px;height:34px;padding:0 13px;font-size:12px}
  body.studio-v2.editor-page .app-header #studio-canvas-expand{
    height:34px!important;min-height:34px!important;width:29px!important;min-width:29px!important;font-size:13.5px!important;
  }
}
