:root {
  --bg: #06080f;
  --ink: #eaf0ff;
  --muted: #8a93b2;
  --accent: #00e5ff;
  --accent2: #b14bff;
  --good: #21d07a;
  --warn: #ffb020;
  --bad: #ff5470;
  --card: rgba(18, 24, 44, 0.72);
  --line: rgba(140, 160, 220, 0.16);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: radial-gradient(1200px 800px at 70% -10%, #131a36 0%, var(--bg) 55%);
  color: var(--ink); -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; height: 100dvh; }

/* ---------- Barra superior ---------- */
.bar {
  position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px;
}
.brand {
  font-weight: 800; letter-spacing: .16em; font-size: 15px;
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  text-shadow: 0 0 24px rgba(0, 229, 255, .35);
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.brand .thin { color: var(--muted); font-weight: 500; }
.now { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; }
.now-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.now-demo { font-weight: 800; color: var(--accent); }
.status { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; }
.status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.status[data-state="online"] { color: var(--ink); }
.status[data-state="online"] .status-dot { background: var(--good); box-shadow: 0 0 12px var(--good); }
.status[data-state="offline"] .status-dot { background: var(--bad); box-shadow: 0 0 12px var(--bad); }
.status[data-state="connecting"] .status-dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Pantalla limpia: sin marca "PHYGITAL"/punto ni estado "Online" (se mantiene
   el elemento de estado en el DOM —oculto— para no romper console.js). */
.bar .brand, .bar .status { display: none !important; }

/* ---------- Escenario (iframe de la demo) ---------- */
.stagewrap { position: relative; flex: 1; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #06080f; }

/* ---------- Pantalla de reposo ---------- */
.idle { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.idle-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; width: min(1100px, 92vw); }
.idle-copy h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 18px; }
.grad { background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.idle-copy p { color: var(--muted); font-size: clamp(15px, 1.6vw, 19px); line-height: 1.6; margin: 0 0 26px; max-width: 46ch; }
.idle-copy strong { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--ink); }
.chip i { font-style: normal; font-size: 15px; }

.idle-qr { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-wrap { position: relative; width: 300px; height: 300px; border-radius: 24px; padding: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0, 229, 255, .22); }
#qrBig { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr-frame {
  position: absolute; inset: 8px; border-radius: 18px; pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0/30px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0/3px 30px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0/30px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0/3px 30px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100%/30px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100%/3px 30px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100%/30px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100%/3px 30px no-repeat;
  filter: drop-shadow(0 0 6px var(--accent));
}
.room { display: inline-flex; align-items: center; gap: 12px; margin: 20px 0 8px; }
.room-label { text-transform: uppercase; font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.room-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 24px; font-weight: 700; letter-spacing: .04em; color: var(--accent); text-shadow: 0 0 20px rgba(0, 229, 255, .45); }
.idle-qr .hint { color: var(--muted); font-size: 13px; margin: 0; max-width: 30ch; }

/* ---------- Fundido entre demos + pista en esquina ---------- */
.fade { position: absolute; inset: 0; background: #06080f; opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 20; }
.fade.on { opacity: 1; }
.hint-corner { position: absolute; left: 22px; bottom: 20px; z-index: 15; font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.hint-corner b { color: var(--accent); }

@media (max-width: 860px) {
  .idle-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .idle-copy p { margin-inline: auto; }
  .chips { justify-content: center; }
  .qr-wrap { width: 240px; height: 240px; }
}

/* ---------- Landing (hero + scan) ---------- */
.landing { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 96px); align-items: center; width: min(1500px, 90vw); }
.eyebrow { font-size: 13px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin: 0 0 20px; }
.hero-h1 { font-size: clamp(40px, 6.5vw, 120px); line-height: .98; letter-spacing: -.03em; font-weight: 900; margin: 0 0 22px; }
.hero-sub { color: var(--muted); font-size: clamp(16px, 1.7vw, 21px); line-height: 1.6; margin: 0; max-width: 42ch; }
.landing-scan { display: flex; flex-direction: column; align-items: center; text-align: center; transition: opacity .45s ease; }
/* Móvil conectado: atenúa el QR para llevar la mirada al móvil ("mira tu móvil"). */
.landing.connected .landing-scan { opacity: .45; }
.landing-scan .qr-wrap { width: clamp(220px, 30vmin, 440px); height: clamp(220px, 30vmin, 440px); }
.scan-cta { margin: 24px 0 0; font-size: clamp(16px, 1.7vw, 20px); font-weight: 700; color: var(--ink); }
.qr-pulse { position: absolute; inset: -12px; border-radius: 32px; border: 2px solid var(--accent); opacity: 0; animation: qrpulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes qrpulse { 0% { transform: scale(.95); opacity: .5; } 70% { opacity: 0; } 100% { transform: scale(1.14); opacity: 0; } }

/* ---------- Intro popup (lo único que se toca en la pantalla) ---------- */
.intro {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 600px at 50% 32%, rgba(0,229,255,.12), transparent 60%), rgba(4,6,14,.88);
  backdrop-filter: blur(10px); transition: opacity .45s ease;
}
.intro.hide { opacity: 0; pointer-events: none; }
.intro-card { width: min(1280px, 92vw); text-align: center; }
.intro-eyebrow { font-size: 13px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin: 0 0 22px; }
.intro-title {
  font-size: clamp(34px, 6vw, 98px); line-height: 1.08; letter-spacing: -.03em; font-weight: 900; margin: 0 0 14px; padding-bottom: .14em;
  background: linear-gradient(110deg, #ffd23f, #ff7a45, #ff4d8d, #b14bff, #ff4d8d, #ff7a45, #ffd23f);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: intrograd 9s ease-in-out infinite alternate;
}
@keyframes intrograd { to { background-position: 220% 0; } }
.intro-sub { color: var(--muted); font-size: clamp(13px, 1.3vw, 16px); line-height: 1.6; margin: 0 auto 34px; max-width: 42ch; }
.intro-sub .soft { color: #b3bbd6; }
.intro-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.intro-btn { font: inherit; font-weight: 800; font-size: 16px; letter-spacing: .01em; padding: 17px 34px; border-radius: 14px; cursor: pointer; transition: transform .08s, filter .2s, border-color .2s, background .2s; border: 1px solid var(--line); }
.intro-btn:active { transform: translateY(2px) scale(.99); }
.intro-btn.ghost { background: rgba(255,255,255,.04); color: #6b7280; }
.intro-btn.ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(140,160,220,.45); color: #9ca3af; }
.intro-btn.primary {
  border: 0; color: #fff; font-weight: 900;
  background: linear-gradient(115deg, #00b8d4 0%, #6d5cff 55%, #b14bff 100%);
  text-shadow: 0 1px 2px rgba(0,0,0,.28);
  animation: ctapulse 1.8s ease-in-out infinite; /* late para llamar la atención */
}
/* Pulso tipo "ping": el brillo late y un anillo se expande y se desvanece. */
@keyframes ctapulse {
  0%   { box-shadow: 0 12px 28px -8px rgba(0,180,255,.55), 0 0 0 0 rgba(109,92,255,.6); }
  70%  { box-shadow: 0 18px 40px -8px rgba(0,180,255,.9), 0 0 0 16px rgba(109,92,255,0); }
  100% { box-shadow: 0 12px 28px -8px rgba(0,180,255,.55), 0 0 0 0 rgba(109,92,255,0); }
}
.intro-btn.primary:hover { filter: brightness(1.1); }
.intro-arrow { display: inline-block; animation: ctaarrow 1.8s ease-in-out infinite; }
@keyframes ctaarrow { 0%, 100% { transform: translateX(0); } 60% { transform: translateX(5px); } }
.intro-btn.primary:hover .intro-arrow { animation-duration: .9s; }

@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; gap: 30px; text-align: center; justify-items: center; }
  .hero-sub { margin-inline: auto; }
  .landing-scan .qr-wrap { width: 240px; height: 240px; }
}

/* ---------- La pantalla es solo visualización ----------
   La ÚNICA interacción con ratón es elegir en el popup. Lo demás no responde al
   puntero ni se puede seleccionar; la demo NO se juega con el ratón (el iframe
   ignora el puntero) y al elegir se oculta el cursor. Todo el control pasa al
   móvil: escanear el QR / tocar el NFC. */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bar, .now, .status, .brand,
.idle, .landing, .hint-corner,
#stage, .fade { pointer-events: none; }
.intro { pointer-events: auto; }            /* el overlay traga los clics de fondo… */
.intro .intro-btn { pointer-events: auto; } /* …salvo sus dos botones */
img { -webkit-user-drag: none; user-drag: none; }
body.locked { cursor: none; }               /* tras elegir: sin cursor */
