:root {
  --fg: #e9f0ff; --dim: #9fb0cc; --accent: #8fb8ff; --coral: #ff7a5c;
  --glass: rgba(10, 18, 36, 0.55); --line: rgba(160, 190, 255, 0.18);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #03070f; color: var(--fg); overflow: hidden;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
video#cam { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hidden { display: none !important; }

/* Portada */
.screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20;
  background: radial-gradient(120% 80% at 50% 35%, #0d2146 0%, #050b18 55%, #02050b 100%); }
.splash-inner { text-align: center; padding: 32px 28px; max-width: 420px; animation: rise .9s ease both; }
.logo { width: 92px; height: 92px; filter: drop-shadow(0 0 24px rgba(120, 170, 255, .45)); animation: breathe 4s ease-in-out infinite; }
h1 { font-weight: 300; letter-spacing: .32em; text-transform: uppercase; font-size: 30px; margin: 18px 0 6px; padding-left: .32em; }
.tag { color: var(--dim); margin: 0 0 34px; font-size: 15px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
.primary { display: block; width: 100%; padding: 16px; border-radius: 999px; font-size: 16px; letter-spacing: .06em;
  background: linear-gradient(135deg, #5d8eff, #8fb8ff 55%, #ffb199); color: #061024; font-weight: 600;
  box-shadow: 0 10px 34px rgba(93, 142, 255, .35); transition: transform .15s; }
.primary:active { transform: scale(.98); }
.ghost { display: block; width: 100%; margin-top: 12px; padding: 13px; border-radius: 999px; background: transparent;
  border: 1px solid var(--line); color: var(--dim); }
.status { min-height: 1.4em; color: var(--accent); margin: 18px 0 0; font-size: 14px; }
.privacy { color: #6f7f9a; font-size: 12.5px; margin-top: 26px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { transform: scale(1.05); filter: drop-shadow(0 0 34px rgba(255, 140, 110, .4)); } }

/* Barra superior */
#top { position: fixed; left: 0; right: 0; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: linear-gradient(#02050bcc, #02050b00); }
.brand { font-weight: 300; letter-spacing: .28em; text-transform: uppercase; font-size: 12px; color: var(--dim); }
#exp-name { flex: 1; font-size: 15px; letter-spacing: .04em; }
.right { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2a3550; transition: background .2s, box-shadow .2s; }
.dot.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
#hand-l.on { background: var(--coral); box-shadow: 0 0 10px var(--coral); }
.icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--glass);
  border: 1px solid var(--line); color: var(--fg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon svg { width: 20px; height: 20px; }

/* Pista central */
#hint { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 9; padding: 10px 18px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); color: var(--fg); font-size: 14px; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .6s; }
#hint.fade { opacity: 0; }

/* HUD inferior */
#hud { position: fixed; left: 16px; right: 16px; bottom: calc(78px + var(--safe-b)); z-index: 9; text-align: center; pointer-events: none; }
#hud-line { color: var(--dim); font-size: 13px; margin-bottom: 8px; text-shadow: 0 1px 8px #000; }
#bars { display: flex; justify-content: center; gap: 8px; }
.bar { width: 44px; text-align: center; font-size: 10px; color: #7f8fab; }
.bar i { display: block; height: 4px; border-radius: 2px; background: rgba(120, 150, 200, .18); margin-top: 4px; overflow: hidden; }
.bar i b { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .08s linear; }
.bar i.in b { background: var(--coral); }

/* Selector de experiencias */
#exps { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 10px;
  padding: 12px 16px calc(14px + var(--safe-b)); background: linear-gradient(#02050b00, #02050bcc); }
#exps button { padding: 10px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--dim);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 14px; }
#exps button.on { color: #061024; background: linear-gradient(135deg, #8fb8ff, #dbe9ff); border-color: transparent; font-weight: 600; }

/* Vista de cámara */
#pip { position: fixed; right: 14px; top: calc(62px + var(--safe-t)); z-index: 9; width: 120px; height: 90px; border-radius: 12px;
  border: 1px solid var(--line); background: #000a; }

/* Ajustes */
#sheet { position: fixed; inset: 0; z-index: 30; background: rgba(2, 5, 11, .45); display: flex; align-items: flex-end; }
.sheet-inner { width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 20px calc(22px + var(--safe-b));
  background: rgba(10, 16, 30, .92); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: up .25s ease both; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
h2 { font-weight: 400; font-size: 18px; margin: 4px 0 10px; }
.row { display: block; padding: 12px 0; border-bottom: 1px solid rgba(160, 190, 255, .08); color: var(--fg); font-size: 14px; }
.row output { float: right; color: var(--accent); }
.row input[type=range] { width: 100%; margin-top: 10px; accent-color: #8fb8ff; }
.row.check { display: flex; gap: 10px; align-items: center; }
.row.check input { width: 20px; height: 20px; accent-color: #8fb8ff; }
.seg { display: flex; gap: 6px; margin-top: 10px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 10px; background: rgba(120, 150, 200, .1); color: var(--dim); font-size: 13px; }
.seg button.on { background: #8fb8ff; color: #061024; font-weight: 600; }
.tip { color: #74839e; font-size: 12.5px; margin: 14px 0 0; }
