@font-face {
  font-family: PixelOffice;
  src: url("/fonts/FSPixelSansUnicode-Regular.ttf");
}

:root {
  --exec-green: #31df63;
  --exec-green-soft: rgba(49,223,99,.18);
  --exec-bg: #05090d;
  --exec-card: rgba(8,18,24,.92);
  --exec-line: rgba(95,255,150,.24);
  --exec-text: #e9fff1;
  --exec-muted: #9db4a7;
  --exec-red: #ff493f;
  --exec-blue: #3c7dff;
  --exec-orange: #d77420;
  --exec-purple: #7546bc;
  --exec-pink: #b54873;
  --exec-yellow: #b99b26;
}

html, body, #root {
  background:
    radial-gradient(circle at 50% 15%, rgba(31,72,89,.24), transparent 35%),
    linear-gradient(180deg, #080d13, #030507 70%);
}

body {
  font-family: PixelOffice, monospace !important;
  color: var(--exec-text);
}

.exec-shell {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  font-family: PixelOffice, monospace;
  color: var(--exec-text);
}

.exec-topbar {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 34px;
  background: linear-gradient(180deg, rgba(8,15,22,.94), rgba(5,10,15,.82));
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  padding: 0 10px;
}

.exec-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
  white-space: nowrap;
}

.exec-logo .brand {
  color: var(--exec-green);
  text-shadow: 0 0 10px rgba(49,223,99,.55);
}

.exec-nav {
  display: flex;
  gap: 34px;
  color: #cdd6d1;
  font-size: 14px;
}

.exec-nav span {
  opacity: .9;
}

.exec-left {
  position: absolute;
  top: 58px;
  left: 16px;
  width: 265px;
}

.exec-title {
  font-size: 15px;
  margin: 0 0 16px;
  color: #fff;
}

.exec-subtitle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin: 0 0 24px;
}

.exec-dot {
  width: 9px;
  height: 9px;
  background: var(--exec-green);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--exec-green);
}

.exec-box {
  background: linear-gradient(180deg, rgba(10,20,26,.90), rgba(5,10,13,.95));
  border: 1px solid rgba(111,255,162,.16);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.32);
  padding: 14px;
  margin-bottom: 14px;
}

.exec-box h3 {
  font-size: 13px;
  color: #b8c8c0;
  margin: 0 0 10px;
  font-weight: 500;
}

.exec-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.65;
}

.exec-ok {
  color: var(--exec-green);
}

.exec-bar {
  display: grid;
  grid-template-columns: 90px 35px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin: 9px 0;
}

.exec-meter {
  height: 11px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}

.exec-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2db84f, #45ec70);
}

.exec-right {
  position: absolute;
  top: 54px;
  right: 18px;
  width: 360px;
  min-height: 420px;
  border: 3px solid var(--exec-green);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(205,255,220,.98), rgba(206,255,223,.94));
  color: #07130d;
  box-shadow: 0 0 0 4px rgba(49,223,99,.18), 0 20px 40px rgba(0,0,0,.55);
}

.exec-right-head {
  height: 54px;
  background: #072010;
  color: #eaffef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
}

.exec-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.exec-agent-main {
  padding: 22px;
}

.exec-agent-top {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}

.exec-portrait {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid #0a1d11;
  background:
    radial-gradient(circle at 50% 35%, #f6d0a4 0 18%, transparent 19%),
    linear-gradient(180deg, #202020 0 60%, #111 61%);
  box-shadow: inset 0 0 0 7px rgba(0,0,0,.08);
  position: relative;
}

.exec-portrait:after {
  content: "";
  position: absolute;
  left: 30px;
  top: 28px;
  width: 32px;
  height: 38px;
  background: #111;
  border-radius: 12px 12px 8px 8px;
  box-shadow: 0 16px 0 #111;
}

.exec-name {
  font-size: 26px;
  font-weight: 900;
}

.exec-role-big {
  font-size: 16px;
  font-weight: 900;
  margin-top: 2px;
}

.exec-role-sub {
  font-size: 13px;
  margin-top: 2px;
}

.exec-pill {
  display: inline-block;
  margin-top: 9px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #25c755;
  color: #041007;
  font-weight: 900;
  font-size: 11px;
}

.exec-desc {
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.45;
}

.exec-skills {
  border-top: 1px solid rgba(0,0,0,.18);
  border-bottom: 1px solid rgba(0,0,0,.18);
  padding: 16px 0;
}

.exec-skills h4 {
  margin: 0 0 12px;
  font-size: 12px;
}

.exec-skill {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 10px 0;
}

.exec-skill i {
  width: 11px;
  height: 11px;
  display: block;
  border-radius: 50%;
  background: #27c653;
  border: 2px solid #0c3519;
}

.exec-right-foot {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  background: #071016;
  color: #d8ffee;
  margin-top: 16px;
  border-radius: 4px;
  overflow: hidden;
}

.exec-right-foot div {
  padding: 12px;
  border-right: 1px solid rgba(255,255,255,.1);
  font-size: 10px;
}

.exec-right-foot b {
  display: block;
  color: var(--exec-green);
  margin-top: 7px;
  font-size: 13px;
}

.exec-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
}

.exec-agent-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.exec-card {
  min-height: 145px;
  background: linear-gradient(180deg, rgba(12,23,30,.96), rgba(6,12,16,.97));
  border: 1px solid rgba(135,255,182,.16);
  border-radius: 6px;
  box-shadow: 0 14px 26px rgba(0,0,0,.28);
  padding: 12px;
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
}

.exec-card:hover {
  border-color: rgba(49,223,99,.65);
  transform: translateY(-1px);
}

.exec-mini {
  width: 48px;
  height: 62px;
  image-rendering: pixelated;
  border-radius: 7px;
  background: linear-gradient(180deg, #f2c292 0 30%, #111 31% 100%);
  border: 2px solid rgba(255,255,255,.08);
}

.exec-card h4 {
  margin: 0;
  font-size: 18px;
}

.exec-card .abbr {
  font-size: 13px;
  margin-top: 2px;
}

.exec-card .full {
  font-size: 11px;
  color: #ccd8d0;
  margin-bottom: 8px;
}

.exec-card .tag {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
}

.exec-card p {
  grid-column: 1 / span 2;
  color: #cbd5d1;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.38;
}

.exec-online {
  grid-column: 1 / span 2;
  color: var(--exec-green);
  font-size: 12px;
  margin-top: 5px;
}

.exec-info-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .75fr;
  gap: 10px;
}

.exec-info {
  background: linear-gradient(180deg, rgba(8,17,22,.95), rgba(4,9,12,.96));
  border: 1px solid rgba(135,255,182,.16);
  border-radius: 6px;
  min-height: 88px;
  padding: 12px;
  font-size: 11px;
}

.exec-info h3 {
  margin: 0 0 8px;
  color: #eafef0;
  font-size: 13px;
}

.exec-check {
  color: var(--exec-green);
  margin-right: 6px;
}

.exec-x {
  color: var(--exec-red);
  margin-right: 6px;
}

.exec-chatbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 350px;
  height: 36px;
  background: rgba(5,10,14,.90);
  border: 1px solid rgba(128,170,190,.24);
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: rgba(230,244,238,.55);
  font-size: 13px;
}

.exec-send {
  margin-left: auto;
  width: 42px;
  height: 30px;
  border-radius: 5px;
  background: #172138;
  display: grid;
  place-items: center;
  color: #fff;
}

/* lascia visibile e vivo il canvas esistente */
.exec-shell ~ * canvas,
canvas {
  image-rendering: pixelated;
}

@media (max-width: 1300px) {
  .exec-left, .exec-right { display: none; }
  .exec-agent-cards { grid-template-columns: repeat(3, 1fr); }
  .exec-chatbar { bottom: 520px; }
}

/* ===== STEP 3: LIVE AGENTS / BETTER AVATARS ===== */

.exec-hotspots {
  position: absolute;
  top: 58px;
  left: 300px;
  width: 850px;
  height: 440px;
  pointer-events: none;
  z-index: 9998;
}

.exec-hotspot {
  position: absolute;
  width: 88px;
  height: 110px;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 12px;
}

.exec-hotspot:hover {
  background: rgba(49,223,99,.10);
  box-shadow: 0 0 24px rgba(49,223,99,.25);
}

.exec-hotspot.active {
  outline: 2px solid rgba(49,223,99,.85);
  box-shadow: 0 0 20px rgba(49,223,99,.55);
}

.exec-card.active {
  border-color: rgba(49,223,99,.95);
  box-shadow: 0 0 22px rgba(49,223,99,.25);
}

.exec-pixel-person,
.exec-mini,
.exec-portrait {
  image-rendering: pixelated;
}

.exec-mini {
  position: relative;
  overflow: hidden;
  background: transparent !important;
  border: 0 !important;
  width: 58px !important;
  height: 70px !important;
}

.exec-mini::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 5px;
  width: 26px;
  height: 24px;
  border-radius: 8px 8px 6px 6px;
  background: var(--skin,#f1c18d);
  box-shadow:
    -7px 7px 0 var(--hair,#222),
    7px 7px 0 var(--hair,#222),
    0 -4px 0 var(--hair,#222),
    0 18px 0 var(--shirt,#111),
    0 36px 0 var(--pants,#111);
}

.exec-mini::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  width: 32px;
  height: 34px;
  border-radius: 5px;
  background: var(--shirt,#111);
  box-shadow:
    -8px 8px 0 var(--shirt,#111),
    8px 8px 0 var(--shirt,#111),
    -4px 34px 0 var(--pants,#111),
    13px 34px 0 var(--pants,#111);
}

.exec-portrait {
  background: radial-gradient(circle at 50% 45%, var(--skin,#f1c18d) 0 23%, transparent 24%),
              radial-gradient(circle at 50% 38%, var(--hair,#222) 0 34%, transparent 35%),
              linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.08)) !important;
}

.exec-portrait::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 55px;
  width: 28px;
  height: 30px;
  border-radius: 6px;
  background: var(--shirt,#111);
  box-shadow: -14px 10px 0 var(--shirt,#111), 14px 10px 0 var(--shirt,#111);
}

.exec-portrait::after {
  background: transparent !important;
  box-shadow: none !important;
}

.exec-agent-chip {
  position: absolute;
  background: rgba(5,12,18,.86);
  color: white;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-24px);
}

@media (max-width: 1300px) {
  .exec-hotspots { display:none; }
}

/* STEP 4: il canvas originale deve restare cliccabile */
.exec-hotspots {
  display: none !important;
  pointer-events: none !important;
}

.exec-card,
.exec-right,
.exec-left,
.exec-bottom,
.exec-topbar,
.exec-chatbar {
  pointer-events: auto;
}

/* STEP 5: nasconde eventuale vecchia scheda popup in basso/destra, lascia attiva la logica */
body > div:not(#root) {
  pointer-events: none;
}

.exec-shell,
.exec-shell * {
  pointer-events: none;
}

.exec-card,
.exec-right,
.exec-left,
.exec-bottom,
.exec-topbar,
.exec-chatbar,
.exec-send {
  pointer-events: auto;
}

/* FIX STABLE: lo skin NON deve interferire con movimenti/click del canvas */
.exec-hotspots {
  display: none !important;
  pointer-events: none !important;
}

.exec-shell {
  pointer-events: none !important;
}

.exec-topbar,
.exec-left,
.exec-right,
.exec-bottom,
.exec-chatbar,
.exec-card,
.exec-send {
  pointer-events: auto !important;
}

/* nasconde vecchia card solo se appare come overlay esterno non-root */
body > div:not(#root):not(.exec-shell) {
  display: none !important;
}
