:root {
  --ink: #e6e8e6;
  --dim: rgba(230, 232, 230, 0.5);
  --faint: rgba(230, 232, 230, 0.22);
  --bg: #000;
  --rec: #e0302a;
  --stamp-h: 30px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
body.dragging canvas#gl { cursor: grabbing; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------------------------------------------------------- entrada */
.intro {
  position: fixed; left: max(24px, 6vw); bottom: calc(var(--stamp-h) + max(40px, 9vh));
  max-width: 560px; transition: opacity 1.4s ease, transform 1.4s ease;
}
body.playing .intro { opacity: 0; transform: translateY(12px); pointer-events: none; }
.who { font-weight: 700; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.intro h1 { font-weight: 200; font-size: clamp(40px, 8vw, 92px); line-height: 0.95; letter-spacing: -0.03em; margin-bottom: 34px; }
.list { list-style: none; display: grid; gap: 2px; }
.list button {
  display: flex; gap: 18px; align-items: baseline; padding: 6px 0; font-size: 17px; font-weight: 300;
  color: var(--dim); transition: color 0.3s; text-align: left;
}
.list button:hover, .list button:focus-visible { color: var(--ink); outline: none; }
.list .n { font-weight: 700; font-size: 11px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; width: 18px; }

.hint {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); font-weight: 600; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); opacity: 0; transition: opacity 1.2s; white-space: nowrap; pointer-events: none;
}
.hint.on { opacity: 1; }
@media (max-width: 700px) { .hint { width: calc(100vw - 32px); white-space: normal; text-align: center; line-height: 1.6; } }

/* ---------------------------------------------------------- reproductor */
.player {
  position: fixed; left: max(24px, 6vw); right: max(24px, 6vw); bottom: calc(var(--stamp-h) + 18px);
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 10px 20px; align-items: center;
  opacity: 0; transform: translateY(8px); transition: opacity 1s 0.6s, transform 1s 0.6s; pointer-events: none;
}
body.playing .player { opacity: 1; transform: none; pointer-events: auto; }
.now { display: flex; gap: 14px; align-items: baseline; min-width: 0; }
.now .num { font-weight: 700; font-size: 11px; letter-spacing: 0.14em; color: var(--dim); font-variant-numeric: tabular-nums; }
.now .name { font-weight: 300; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { grid-column: 1 / -1; height: 14px; display: flex; align-items: center; cursor: pointer; }
.bar::before { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: var(--faint); }
.bar { position: relative; }
.fill { position: relative; height: 1px; width: 0; background: var(--ink); }
.ctrl { display: flex; gap: 4px; align-items: center; grid-row: 1; grid-column: 2; }
.ctrl button { width: 36px; height: 36px; display: grid; place-items: center; opacity: 0.75; transition: opacity 0.2s; }
.ctrl button:hover { opacity: 1; }
.ctrl svg { width: 18px; height: 18px; fill: var(--ink); }
.recbtn .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--rec); display: block; transition: border-radius 0.2s; }
body.recording .recbtn .dot { border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------------------------------------------------------- franja de cámara trampa */
.stamp {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--stamp-h) + env(safe-area-inset-bottom));
  padding: 0 max(16px, 2vw) env(safe-area-inset-bottom); display: flex; align-items: center; gap: 14px;
  background: #000; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-variant-numeric: tabular-nums;
  color: #d9dcd9;
}
.stamp .grow { flex: 1; }
.stamp svg { width: 13px; height: 13px; }
.stamp .mo { fill: none; stroke: #d9dcd9; stroke-width: 1; }
.stamp path { fill: #d9dcd9; }
.stamp.shot { color: #fff; }
@media (max-width: 560px) { #sShot, #sDate { display: none; } }

/* ---------------------------------------------------------- compartir */
.share { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.7); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.share.on { opacity: 1; pointer-events: auto; }
.sheet { display: flex; gap: 20px; align-items: flex-end; padding: 16px; }
.sheet video { height: min(70vh, 640px); aspect-ratio: 9 / 16; background: #000; border: 1px solid var(--faint); }
.side { display: grid; gap: 8px; }
.btn { display: inline-block; padding: 10px 16px; border: 1px solid var(--ink); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; text-align: center; }
.btn.ghost { border-color: var(--faint); color: var(--dim); }
.btn.solid { background: var(--ink); color: #000; cursor: pointer; }
.side .note { max-width: 190px; font-size: 11px; line-height: 1.5; color: var(--dim); }
@media (max-width: 560px) { .sheet { flex-direction: column; align-items: center; } .sheet video { height: 60vh; } .side { grid-auto-flow: column; } .side .note { display: none; } }

/* ---------------------------------------------------------- efectos y volver */
.pads {
  position: fixed; right: max(24px, 6vw); bottom: calc(var(--stamp-h) + 118px);
  display: flex; gap: 8px; opacity: 0; pointer-events: none; transition: opacity 1s ease 0.8s;
}
body.playing .pads { opacity: 1; pointer-events: auto; }
.pad {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 66px; padding: 8px 10px 7px;
  border: 1px solid var(--faint); border-radius: 10px; color: var(--dim); touch-action: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.pad kbd { font: 700 10px Manrope, sans-serif; letter-spacing: 0.12em; }
.pad span { font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.pad.on { color: #000; background: var(--ink); border-color: var(--ink); }
@media (pointer: coarse) { .pad kbd { display: none; } }
@media (max-width: 560px) {
  .pads { left: 16px; right: 16px; bottom: calc(var(--stamp-h) + 112px); justify-content: space-between; }
  .pad { flex: 1; min-width: 0; padding: 10px 4px; }
}
