/* ═══════════════ Emoji Heroes · Modo desarrollador ═══════════════
   Solo se usa con ?dev=1. Estilo de la biblia visual: paneles índigo
   translúcidos, esquinas muy redondeadas, títulos amarillos, Fredoka.
   Clases propias (eh-dev-*) para no tocar la UI del juego. */

.eh-dev-root {
  --dev-yellow: #ffc928;
  --dev-yellow-hi: #fff3a8;
  --dev-green: #5bd23c;
  --dev-green-dk: #2c7a38;
  --dev-white: #f4f1ff;
  --dev-ink: #1b1446;
  --dev-panel: linear-gradient(180deg, rgba(98, 82, 232, 0.94), rgba(59, 47, 184, 0.94));
  --dev-border: rgba(183, 174, 255, 0.6);
  --dev-emoji-font: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', emoji, sans-serif;

  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: 'Fredoka', var(--dev-emoji-font);
  font-weight: 600;
  color: var(--dev-white);
  z-index: 60;
  -webkit-tap-highlight-color: transparent;
}
.eh-dev-root *, .eh-dev-root *::before, .eh-dev-root *::after { box-sizing: border-box; }
.eh-dev-hidden { display: none !important; }

/* El juego detecta si la fuente web de emojis pinta (prueba en canvas) y,
   si no pinta, cambia a la del sistema con .eh-sysemoji en .eh-root. El
   panel sigue esa misma decisión: sin esto, sus emojis quedan invisibles
   en los navegadores donde la fuente web no pinta. */
#ui:has(.eh-root.eh-sysemoji) .eh-dev-root {
  --dev-emoji-font: 'Apple Color Emoji', 'Segoe UI Emoji', emoji, sans-serif;
}

/* ── Rótulo siempre visible ── */
.eh-dev-badge {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px 6px;
  border-radius: 99em;
  background: rgba(59, 47, 184, 0.88);
  border: 2px solid var(--dev-border);
  box-shadow: 0 3px 0 rgba(27, 20, 70, 0.5);
  color: var(--dev-yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Botón flotante (abrir/cerrar) ── */
/* Arriba a la derecha, debajo de los botones del HUD (pausa/mapa): fuera del
 * área de control, para que no tape ningún botón táctil. */
.eh-dev-fab {
  position: absolute;
  top: calc(84px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(180deg, #6f60f0, #4a3bd0);
  border: 2px solid var(--dev-border);
  box-shadow: 0 4px 0 rgba(27, 20, 70, 0.55), 0 8px 16px rgba(27, 20, 70, 0.4);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease;
}
.eh-dev-fab:active { transform: translateY(3px) scale(0.96); }

/* ── Panel lateral ── */
.eh-dev-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 94vw);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: var(--dev-panel);
  border-left: 3px solid var(--dev-border);
  border-radius: 22px 0 0 22px;
  box-shadow: -12px 0 32px rgba(27, 20, 70, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.eh-dev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px 18px;
  flex: none;
}
.eh-dev-title {
  margin: 0;
  flex: 1;
  font-size: 19px;
  font-weight: 700;
  color: var(--dev-yellow);
  -webkit-text-stroke: 1px var(--dev-ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--dev-ink);
  letter-spacing: 0.02em;
}
.eh-dev-close {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #f2452e, #c22e1d);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 0 rgba(27, 20, 70, 0.5);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.eh-dev-close:active { transform: translateY(2px); }
.eh-dev-status {
  flex: none;
  margin: 0 14px 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(27, 20, 70, 0.45);
  border: 1px solid rgba(183, 174, 255, 0.35);
  font-size: 13px;
  line-height: 1.5;
}
.eh-dev-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 18px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Secciones y botones ── */
.eh-dev-section { margin-bottom: 16px; }
.eh-dev-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--dev-yellow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 var(--dev-ink);
}
.eh-dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.eh-dev-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.eh-dev-zone {
  margin: 10px 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.eh-dev-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #6f60f0, #4a3bd0);
  border: 2px solid var(--dev-border);
  box-shadow: 0 3px 0 rgba(27, 20, 70, 0.5);
  color: var(--dev-white);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.eh-dev-btn:active { transform: translateY(2px) scale(0.98); }
.eh-dev-btn.eh-dev-wide { grid-column: 1 / -1; }
.eh-dev-btn.eh-dev-chip { flex: 0 1 auto; padding: 8px 12px; border-radius: 99em; }
.eh-dev-btn.eh-dev-gold {
  background: linear-gradient(180deg, #ffb400, #ff9416);
  border-color: rgba(255, 243, 168, 0.8);
  color: var(--dev-ink);
}
.eh-dev-emo {
  font-family: var(--dev-emoji-font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  flex: none;
}
.eh-dev-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eh-dev-check {
  display: none;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dev-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(27, 20, 70, 0.5);
}
/* Obtenido: verde + ✓. Activo: borde dorado con brillo. */
.eh-dev-btn.is-owned { background: linear-gradient(180deg, #3f9e4d, var(--dev-green-dk)); border-color: rgba(150, 255, 170, 0.7); }
.eh-dev-btn.is-owned .eh-dev-check { display: inline-block; }
.eh-dev-btn.is-active {
  border-color: var(--dev-yellow);
  box-shadow: 0 3px 0 rgba(27, 20, 70, 0.5), 0 0 0 2px var(--dev-yellow), 0 0 16px rgba(255, 201, 40, 0.55);
}
.eh-dev-btn.is-on { background: linear-gradient(180deg, #3f9e4d, var(--dev-green-dk)); border-color: rgba(150, 255, 170, 0.7); }
.eh-dev-btn.is-on .eh-dev-check { display: inline-block; }

.eh-dev-hint {
  margin-top: 4px;
  text-align: center;
  font-size: 12px;
  opacity: 0.75;
}
