/* Orbit — interfaz. Casi nada, fino y encima de la imagen: lo que manda es el agujero negro. */
:root {
  --tinta: rgba(255, 255, 255, .92);
  --tenue: rgba(255, 255, 255, .5);
  --linea: rgba(255, 255, 255, .22);
  --fuente: "Helvetica Neue", "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #000; color: var(--tinta); font-family: var(--fuente); overflow: hidden; -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
#lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
body.arrastrando #lienzo { cursor: grabbing; }
body.cayendo #lienzo { cursor: none; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 1px solid rgba(255, 255, 255, .7); outline-offset: 4px; }

/* ---------- título y botón, abajo al centro ---------- */
#pie {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center;
  padding: 0 16px max(6.5vh, calc(env(safe-area-inset-bottom) + 18px)); text-align: center; pointer-events: none;
}
#pie::before {   /* sombra suave detrás del título, para que se lea sobre las estrellas */
  content: ""; position: absolute; inset: -22vh 0 0; z-index: -1; opacity: 0; transition: opacity 2.5s ease;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
}
h1 {
  font-weight: 200; font-size: clamp(44px, 9vw, 120px); letter-spacing: .62em; margin-right: -.62em; line-height: 1;
  text-shadow: 0 0 40px rgba(255, 200, 140, .25); opacity: 0; transition: opacity 1.4s ease;
}
body.ver-titulo h1 { opacity: 1; transition-duration: 3s; }
body.ver-titulo #pie::before { opacity: 1; }

#caer {
  margin-top: clamp(26px, 4.5vh, 44px); padding: 13px 52px 13px calc(52px + .4em); font-weight: 300; font-size: 13px; letter-spacing: .4em; text-transform: uppercase;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--linea); border-radius: 2px; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease, background .25s, border-color .25s;
}
body.ver-controles #caer { opacity: 1; pointer-events: auto; }
#caer:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .6); }
#caer:active { background: rgba(255, 255, 255, .2); }

#pista { margin-top: 20px; height: 1.4em; font-size: 12px; font-weight: 300; letter-spacing: .08em; color: var(--tenue); opacity: 0; transition: opacity 1.2s ease; }
body.ver-pista #pista { opacity: 1; }
.con-dedo { display: none; }
@media (pointer: coarse) { .con-mouse { display: none; } .con-dedo { display: inline; } }

/* ---------- sonido y pantalla completa, arriba a la derecha ---------- */
#esquina {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; gap: 2px;
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease;
}
body.ver-controles #esquina { opacity: 1; pointer-events: auto; }
#esquina button { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; cursor: pointer; opacity: .55; transition: opacity .25s, background .25s; }
#esquina button:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
#esquina button.activo { opacity: .95; }
#esquina svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
#sonido .ondas { display: none; }
#sonido.activo .ondas { display: inline; }
#sonido.activo .mudo { display: none; }

/* durante la caída no queda nada en pantalla */
body.cayendo #pie, body.cayendo #esquina { opacity: 0; pointer-events: none; transition: opacity .8s ease; }
body.cayendo #caer { pointer-events: none; }

#depura { position: fixed; left: 16px; top: 14px; font: 11px/1.5 ui-monospace, Menlo, monospace; color: var(--tenue); white-space: pre; pointer-events: none; }
#sin-webgl { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--tenue); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { h1, #caer, #pista, #esquina, #pie::before { transition-duration: .3s !important; } }
