:root {
  --ink: #ece4e0;
  --dim: rgba(236, 228, 224, 0.5);
  --faint: rgba(236, 228, 224, 0.2);
  --bg: #000;
  --ui: 1;
}
* { 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; -webkit-touch-callout: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* en el refugio no hay interfaz: se va apagando sola mientras te calmas */
.ui { opacity: var(--ui); }

/* ---------------------------------------------------------- entrada */
.intro {
  position: fixed; left: max(24px, 6vw); bottom: max(64px, 12vh);
  max-width: 560px; transition: opacity 1.6s ease, transform 1.6s 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(30px + 18px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 10px 20px; align-items: center;
  visibility: hidden; pointer-events: none;
}
body.playing .player { visibility: visible; 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; position: relative; }
.bar::before { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: var(--faint); }
.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: #e0302a; display: block; transition: border-radius 0.2s; }
body.recording .recbtn .dot { border-radius: 2px; animation: blink 1s steps(2) infinite; }
body.recording .ui { opacity: 1; }   /* mientras grabas, el botón no se apaga */
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------------------------------------------------------- A S D F */
.pads {
  position: fixed; right: max(24px, 6vw); bottom: calc(30px + 118px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; visibility: hidden; pointer-events: none;
}
body.playing .pads { visibility: visible; pointer-events: auto; }
.pad {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 70px; 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(30px + 112px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .pad { flex: 1; min-width: 0; padding: 10px 4px; }
}

/* ---------------------------------------------------------- la franja con la hora: lo último del EP anterior */
.stamp {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(30px + env(safe-area-inset-bottom));
  padding: 0 max(16px, 2vw) env(safe-area-inset-bottom); display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  font-weight: 700; font-size: 11px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; color: rgba(236, 228, 224, 0.55);
  pointer-events: none;
}

/* ---------------------------------------------------------- compartir */
.share { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); opacity: 0; pointer-events: none; transition: opacity 0.6s; }
.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; } }
