/* ============================================================
   JAVI AR — Estilo Stark/HUD holográfico.
   Negro + cyan. Todo lo que ves está pensado para estar
   FLOTANDO sobre el mundo real (passthrough), no encima de
   un fondo opaco.
   ============================================================ */

:root {
  --bg: #000000;
  --srf: #0a0e12;
  --ln: #1a2226;
  --tx: #e6f3f7;
  --t2: #88a8b3;
  --ac: #4cc3d9;
  --ac-dim: #1a4a55;
  --err: #ff6b6b;
  --ok: #4bbf7e;
  --wa: #d8a53c;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--tx);
  font-family: var(--sans);
  font-size: 14px; line-height: 1.5;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  height: 100%;
}

/* ------------------------------------------------------------
   FASE PRE-AR: pantalla 2D antes de entrar a AR.
   Tipografía Stark, layout mobile-first porque la pantalla
   del navegador del Quest es chica y vertical.
   ------------------------------------------------------------ */
.pre-ar {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(circle at 50% 0%, #0a1520 0%, #000 60%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.pre-ar__head {
  padding: 24px 20px 12px;
  text-align: center;
}

.pre-ar__logo {
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.15em;
  color: var(--ac);
  text-shadow: 0 0 12px rgba(76, 195, 217, 0.5);
}

.pre-ar__sub {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-top: 4px;
}

.pre-ar__body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pre-ar__foot {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--t2);
  border-top: 1px solid var(--ln);
}

.pre-ar__foot a {
  color: var(--ac);
  text-decoration: none;
}

/* ------------------------------------------------------------
   Cards: bloques de la fase pre-AR.
   ------------------------------------------------------------ */
.card {
  background: var(--srf);
  border: 1px solid var(--ln);
  border-radius: 14px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 24px rgba(76, 195, 217, 0.08);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--tx);
  letter-spacing: 0.02em;
}

.card--err { border-color: var(--err); }
.card--err h2 { color: var(--err); }

.muted { color: var(--t2); margin: 0 0 16px; font-size: 13px; }
.small { font-size: 11px; }

.mono { font-family: var(--mono); }

/* ------------------------------------------------------------
   QR de emparejamiento.
   ------------------------------------------------------------ */
.qr {
  margin: 20px auto;
  background: white;
  padding: 12px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 0 32px rgba(76, 195, 217, 0.4);
}

.qr img { display: block; width: 200px; height: 200px; }

.qr-url {
  font-size: 10px;
  color: var(--t2);
  word-break: break-all;
  max-width: 280px;
  margin: 0 auto 16px;
}

/* ------------------------------------------------------------
   Botones.
   ------------------------------------------------------------ */
.btn {
  appearance: none;
  border: 1px solid var(--ln);
  background: var(--srf);
  color: var(--tx);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none; user-select: none;
}

.btn:hover { border-color: var(--ac); color: var(--ac); }

.btn--primary {
  background: var(--ac);
  color: #001a1f;
  border: 0;
  font-weight: 600;
  font-size: 16px;
  padding: 16px 28px;
  letter-spacing: 0.05em;
  margin: 12px 0;
  box-shadow: 0 0 32px rgba(76, 195, 217, 0.5);
}

.btn--primary:active { transform: scale(0.98); }

/* ------------------------------------------------------------
   FASE AR: el canvas de A-Frame cubre todo.
   El fondo es transparente (passthrough).
   ------------------------------------------------------------ */
.ar-root { position: fixed; inset: 0; background: transparent; }

a-scene { background: transparent !important; }

/* ------------------------------------------------------------
   Botones 2D sobre el canvas AR. Esquina inferior.
   ------------------------------------------------------------ */
.ar-btn {
  position: fixed;
  bottom: 28px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--ac);
  background: rgba(0, 12, 18, 0.85);
  color: var(--ac);
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(76, 195, 217, 0.4);
  transition: all 0.15s;
  -webkit-user-select: none; user-select: none;
}

.ar-btn:hover { background: rgba(76, 195, 217, 0.2); }
.ar-btn:active { transform: scale(0.95); }

.ar-btn--add    { right: 28px; }
.ar-btn--toggle { right: 96px; }
.ar-btn--exit   { left: 28px; border-color: var(--err); color: var(--err); box-shadow: 0 0 16px rgba(255, 107, 107, 0.3); }

/* ------------------------------------------------------------
   Menú radial: aparece flotando al tocar +.
   ------------------------------------------------------------ */
.radial {
  position: fixed;
  bottom: 100px;
  right: 56px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-gap: 8px;
  background: rgba(0, 12, 18, 0.85);
  border: 1px solid var(--ac);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 32px rgba(76, 195, 217, 0.3);
  animation: radialIn 0.2s ease-out;
}

@keyframes radialIn {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.radial__item {
  appearance: none;
  border: 1px solid var(--ln);
  background: var(--srf);
  color: var(--tx);
  width: 64px; height: 64px;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  -webkit-user-select: none; user-select: none;
}

.radial__item:hover { border-color: var(--ac); }
.radial__item--sm { font-size: 10px; }

/* ------------------------------------------------------------
   Toast: mensajes efímeros abajo.
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 12, 18, 0.9);
  color: var(--ac);
  border: 1px solid var(--ac);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 12px;
  z-index: 30;
  box-shadow: 0 0 24px rgba(76, 195, 217, 0.4);
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}