/* Reproductor de episodios de One Way Ticket · formato de audio */

.app-header { border-bottom: 1px solid var(--line-soft); }
.app-header .inner { max-width: 1240px; margin: 0 auto; padding: 8px clamp(12px, 4vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--text); }
.app-brand:hover { color: var(--text); }
.app-brand img { width: 44px; height: 44px; flex: 0 0 auto; }
.app-brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 420px) { .app-brand span { font-size: 19px; } }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border-bottom: 2px solid var(--naranja); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }

.iab { max-width: 1240px; margin: 12px auto 0; padding: 0 clamp(12px, 4vw, 48px); }
.iab-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border: 1px solid var(--naranja); border-radius: 12px; background: rgba(255, 94, 19, 0.08); }
.iab-box p { flex: 1 1 260px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.iab-box strong { color: var(--text); }
.iab-box .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }

.app-main { max-width: 1240px; margin: 0 auto; padding: 32px 48px 72px; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px 56px; }

/* ---------- Columna del reproductor: la historia arriba, el reproductor abajo ---------- */
.player-col {
  /* Unos 2 cm entre la historia y el reproductor; en pantallas bajitas se juntan y la columna se angosta para que todo quepa */
  --gap: clamp(24px, calc(100vh - 820px), 2cm);
  --colw: clamp(300px, calc((100vh - var(--top, 61px) - 48px - var(--gap) - 206px) * 0.78), 400px);
  flex: 0 0 var(--colw); width: var(--colw); min-width: 0; display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 16px; height: clamp(560px, calc(100vh - var(--top, 61px) - 48px), calc(var(--colw) * 16 / 9 + var(--gap) + 206px));
}

/* La pantalla de la historia */
.stage { --u: 4px; position: relative; flex: 1 1 auto; min-height: 0; max-height: calc(var(--colw) * 16 / 9); overflow: hidden; border-radius: 18px; background: #000; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); container-type: size; container-name: stage; user-select: none; -webkit-user-select: none; }
@supports (width: 1cqh) {
  /* Una "unidad" que cabe siempre: el contenido se dibuja como si fuera un cuadro 9:16 dentro del espacio que haya */
  .stage { --u: min(1cqw, 0.72cqh); }
}
.scene { position: absolute; inset: 0; overflow: hidden; }

/* Lugares: imagen fija animada (o clip mudo) */
.place { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.place.is-on { opacity: 1; }
.place img, .place video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 1.2s ease; }
.place img { animation: kenburns 26s ease-in-out infinite alternate; transform-origin: 50% 45%; }
.place.fx-desenfoque img, .place.fx-desenfoque video { filter: blur(9px) brightness(0.5) saturate(0.9); }
.place::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; background: radial-gradient(ellipse at 60% 30%, rgba(255, 160, 80, 0.38), rgba(255, 120, 40, 0.14) 55%, rgba(255, 120, 40, 0) 80%); mix-blend-mode: screen; }
.place.fx-calido::after { opacity: 1; }
@keyframes kenburns {
  0% { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.15) translate(-1.4%, -1.8%); }
}

/* Lluvia */
.rain { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; overflow: hidden; }
.rain.is-on { opacity: 1; }
.drop { position: absolute; top: 0; height: 100%; width: 1px; background: linear-gradient(to bottom, rgba(220, 235, 255, 0) calc(100% - var(--len)), rgba(220, 235, 255, var(--alpha)) 100%); animation: fall var(--dur) linear infinite; animation-delay: var(--delay); }
@keyframes fall {
  from { transform: translate(0, -100%) rotate(8deg); }
  to { transform: translate(-24px, 100%) rotate(8deg); }
}

/* Parpadeo suave de luz */
.light { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity 1.2s ease; }
.light.lampara { background: radial-gradient(circle at 20% 30%, rgba(255, 170, 90, 0.42), rgba(255, 170, 90, 0) 45%); }
.light.fria { background: radial-gradient(circle at 75% 18%, rgba(0, 210, 255, 0.22), rgba(0, 210, 255, 0) 55%); }
.light.is-on { animation: flicker 7.3s infinite; }
@keyframes flicker {
  0%, 100% { opacity: 0.6; } 7% { opacity: 0.4; } 8% { opacity: 0.75; } 9% { opacity: 0.45; }
  31% { opacity: 0.65; } 54% { opacity: 0.5; } 55% { opacity: 0.8; } 57% { opacity: 0.55; } 80% { opacity: 0.68; }
}

.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%), linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.55) 100%); }

.stage.is-ended .mark, .stage.is-soon .mark { opacity: 0; }
.mark { position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 5.5); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.6); pointer-events: none; }
.mark img { width: calc(var(--u) * 9); height: calc(var(--u) * 9); }
.mark span { font-family: var(--body); font-weight: 700; font-size: calc(var(--u) * 2.6); letter-spacing: 0.16em; color: rgba(242, 244, 247, 0.85); }

/* Tarjetas */
.card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 calc(var(--u) * 8); opacity: 0; transform: scale(0.97); transition: opacity 0.35s ease, transform 0.35s ease; pointer-events: none; }
.card.is-on { opacity: 1; transform: none; }
.card.scrim::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0% 0%, rgba(0, 210, 255, 0.2), rgba(0, 210, 255, 0) 45%), radial-gradient(circle at 100% 100%, rgba(255, 94, 19, 0.24), rgba(255, 94, 19, 0) 45%), linear-gradient(180deg, rgba(9, 11, 14, 0.86) 0%, rgba(26, 30, 36, 0.8) 55%, rgba(9, 11, 14, 0.9) 100%); }
.card .aro { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 84); height: calc(var(--u) * 84); transform: translate(-50%, -50%); opacity: 0.42; }
.card.is-list .aro { width: calc(var(--u) * 104); height: calc(var(--u) * 104); opacity: 0.28; }
.card .inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.8); max-width: calc(var(--u) * 84); }
.card .label { font-family: 'Inter', var(--body); font-weight: 800; font-size: calc(var(--u) * 3.3); letter-spacing: 0.04em; text-transform: uppercase; }
.card .label.dilo { color: var(--naranja); }
.card .label.pregunta { color: var(--cian); }
.card .phrase { font-family: 'Inter', var(--body); font-weight: 900; color: #fff; line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.card .phrase.s1 { font-size: calc(var(--u) * 14); }
.card .phrase.s2 { font-size: calc(var(--u) * 11.5); }
.card .phrase.s3 { font-size: calc(var(--u) * 10); }
.card .phrase.s4 { font-size: calc(var(--u) * 9); }
.card .phrase.s5 { font-size: calc(var(--u) * 7.6); }
.card .alumno { font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 4.6); color: var(--naranja); }
.card .pron { font-family: 'Inter', var(--body); font-weight: 600; font-size: calc(var(--u) * 5); color: var(--cian); }
.card .nota { font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 4.4); color: var(--text-3); }
.card .items { display: flex; flex-direction: column; gap: calc(var(--u) * 2.6); }
.card .items b { display: block; font-family: 'Inter', var(--body); font-weight: 900; font-size: calc(var(--u) * 6.6); line-height: 1.05; color: #fff; }
.card .items small { display: block; font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 3.8); color: var(--text-3); }
.card .items.pronunciacion small { color: var(--cian); }
.card.rte .inner { gap: calc(var(--u) * 3); }
.card.rte .line { padding: calc(var(--u) * 0.6) calc(var(--u) * 2.4); background: rgba(8, 9, 11, 0.85); font-family: var(--display); font-weight: 900; font-size: calc(var(--u) * 9.5); line-height: 1; color: var(--naranja); text-transform: uppercase; }
.card.titulo .kick { font-family: 'Inter', var(--body); font-weight: 600; font-size: calc(var(--u) * 3); letter-spacing: 0.24em; color: var(--text-2); }
.card.titulo .big { font-family: 'Inter', var(--body); font-weight: 900; font-size: calc(var(--u) * 13); line-height: 0.98; letter-spacing: 0.01em; background: linear-gradient(180deg, #ffffff 0%, #c9d2dc 55%, #9aa6b3 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(-1px 0 10px rgba(0, 210, 255, 0.45)) drop-shadow(2px 0 12px rgba(255, 94, 19, 0.35)); }
.card.titulo .bar { width: calc(var(--u) * 34); height: calc(var(--u) * 0.6); background: linear-gradient(90deg, var(--cian), var(--naranja)); }
.card.titulo .sub { font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 5.4); letter-spacing: 0.22em; color: #fff; }
.card.titulo .line2 { font-family: 'Inter', var(--body); font-weight: 600; font-size: calc(var(--u) * 2.8); letter-spacing: 0.14em; color: var(--text-3); }
.card.titulo .orange { color: var(--naranja); font-size: calc(var(--u) * 3.2); letter-spacing: 0.24em; font-weight: 700; }
.card.llamada .phone { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2.4); padding: calc(var(--u) * 7) calc(var(--u) * 8); border-radius: calc(var(--u) * 6); background: rgba(9, 11, 14, 0.78); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); }
.card.llamada .who { font-family: 'Inter', var(--body); font-weight: 600; font-size: calc(var(--u) * 3.6); letter-spacing: 0.08em; color: var(--text-3); text-transform: uppercase; }
.card.llamada .num { font-family: 'Inter', var(--body); font-weight: 800; font-size: calc(var(--u) * 7.4); color: #fff; }
.card.llamada .btns { display: flex; gap: calc(var(--u) * 14); margin-top: calc(var(--u) * 3); }
.card.llamada .btns span { width: calc(var(--u) * 13); height: calc(var(--u) * 13); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.card.llamada .ok { background: #1FB25A; animation: ring 1.2s ease-in-out infinite; }
.card.llamada .no { background: #E5484D; }
@keyframes ring { 0%, 100% { transform: none; } 20% { transform: rotate(-10deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }

@media (prefers-reduced-motion: reduce) {
  .place img { animation: none; }
  .rain { display: none; }
  .light.is-on { animation: none; opacity: 0.55; }
}

/* Tarjetas de RTE con frases largas */
.card.rte .line.long { font-size: calc(var(--u) * 7.2); }
.card.llamada .org { font-family: 'Inter', var(--body); font-weight: 700; font-size: calc(var(--u) * 4.6); color: #fff; }

/* Nota de voz (tipo WhatsApp, sin su logo) */
.card.dim::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 9, 11, 0.35), rgba(8, 9, 11, 0.6)); }
.vnote { position: relative; width: calc(var(--u) * 80); display: flex; flex-direction: column; gap: calc(var(--u) * 2.4); padding: calc(var(--u) * 3.6) calc(var(--u) * 4) calc(var(--u) * 2.6); border-radius: calc(var(--u) * 1.2) calc(var(--u) * 5) calc(var(--u) * 5) calc(var(--u) * 5); background: #1F2C34; box-shadow: 0 calc(var(--u) * 3) calc(var(--u) * 10) rgba(0, 0, 0, 0.45); text-align: left; }
.vnote::before { content: ""; position: absolute; top: 0; left: calc(var(--u) * -2.4); border-top: calc(var(--u) * 3) solid #1F2C34; border-left: calc(var(--u) * 2.6) solid transparent; }
.vn-head { display: flex; align-items: center; gap: calc(var(--u) * 3); }
.vn-avatar { position: relative; flex: 0 0 auto; width: calc(var(--u) * 12); height: calc(var(--u) * 12); border-radius: 50%; background: linear-gradient(135deg, #3A414D, #232831); display: flex; align-items: center; justify-content: center; font-family: 'Inter', var(--body); font-weight: 800; font-size: calc(var(--u) * 5.2); color: #D5DBE3; }
.vn-mic { position: absolute; right: calc(var(--u) * -1); bottom: calc(var(--u) * -1); width: calc(var(--u) * 5.4); height: calc(var(--u) * 5.4); border-radius: 50%; background: #1F2C34; color: var(--cian); display: flex; align-items: center; justify-content: center; }
.vn-mic svg { width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); }
.vn-who b { display: block; font-family: 'Inter', var(--body); font-weight: 700; font-size: calc(var(--u) * 4.6); color: var(--naranja); }
.vn-who small { display: block; font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 3.2); color: #8696A0; }
.vn-body { display: flex; align-items: center; gap: calc(var(--u) * 2.6); }
.vn-play { flex: 0 0 auto; width: calc(var(--u) * 8); height: calc(var(--u) * 8); color: #D5DBE3; display: flex; align-items: center; justify-content: center; }
.vn-play svg { width: calc(var(--u) * 7); height: calc(var(--u) * 7); }
.vn-wave { position: relative; flex: 1 1 auto; height: calc(var(--u) * 9); }
.vn-bars { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; }
.vn-bars i { display: block; width: calc(var(--u) * 1.05); border-radius: calc(var(--u) * 0.6); background: #5B6B75; }
.vn-bars.played { clip-path: inset(0 100% 0 0); }
.vn-bars.played i { background: var(--cian); }
.vn-foot { display: flex; justify-content: space-between; font-family: 'Inter', var(--body); font-size: calc(var(--u) * 3); color: #8696A0; }

/* El boleto de avión */
.card.boleto::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(8, 9, 11, 0.25), rgba(8, 9, 11, 0.7)); }
.ticket { position: relative; width: calc(var(--u) * 82); display: flex; flex-direction: column; border-radius: calc(var(--u) * 4); background: #F2F4F7; color: #12151A; text-align: left; box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 14) rgba(0, 0, 0, 0.55); transform: rotate(-4deg); }
.card.boleto.is-on .ticket { animation: tk-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes tk-in { from { transform: translateY(calc(var(--u) * 10)) rotate(2deg); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.tk-main { display: flex; flex-direction: column; gap: calc(var(--u) * 2.6); padding: calc(var(--u) * 4.6) calc(var(--u) * 5) calc(var(--u) * 4); border-left: calc(var(--u) * 1.8) solid var(--naranja); border-radius: calc(var(--u) * 4) calc(var(--u) * 4) 0 0; }
.tk-top { display: flex; align-items: center; justify-content: space-between; }
.tk-top span { font-family: var(--mono); font-weight: 700; font-size: calc(var(--u) * 2.8); letter-spacing: 0.2em; color: #5A6270; }
.tk-top img { width: calc(var(--u) * 10); height: calc(var(--u) * 10); }
.tk-big { font-family: 'Inter', var(--body); font-weight: 900; font-size: calc(var(--u) * 10.5); line-height: 0.92; letter-spacing: -0.01em; color: #12151A; }
.tk-row { display: flex; gap: calc(var(--u) * 6); }
.tk-row small { display: block; font-family: var(--mono); font-size: calc(var(--u) * 2.5); letter-spacing: 0.16em; color: #8B95A3; }
.tk-row b { display: block; font-family: 'Inter', var(--body); font-weight: 800; font-size: calc(var(--u) * 4.4); color: #12151A; }
.tk-row .to b { color: var(--naranja); }
.tk-cut { position: relative; height: 0; border-top: calc(var(--u) * 0.5) dashed #B4BCC8; margin: 0 calc(var(--u) * 4); }
.tk-cut::before, .tk-cut::after { content: ""; position: absolute; top: calc(var(--u) * -2.6); width: calc(var(--u) * 5.2); height: calc(var(--u) * 5.2); border-radius: 50%; background: #0D0F13; }
.tk-cut::before { left: calc(var(--u) * -6.6); }
.tk-cut::after { right: calc(var(--u) * -6.6); }
.tk-stub { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 4); padding: calc(var(--u) * 3.4) calc(var(--u) * 5) calc(var(--u) * 4); }
.tk-code { flex: 1 1 auto; height: calc(var(--u) * 8); background: repeating-linear-gradient(90deg, #12151A 0 calc(var(--u) * 0.5), transparent calc(var(--u) * 0.5) calc(var(--u) * 1.1), #12151A calc(var(--u) * 1.1) calc(var(--u) * 2), transparent calc(var(--u) * 2) calc(var(--u) * 2.4), #12151A calc(var(--u) * 2.4) calc(var(--u) * 2.7), transparent calc(var(--u) * 2.7) calc(var(--u) * 3.6)); opacity: 0.85; }
.tk-stub span { font-family: var(--mono); font-weight: 700; font-size: calc(var(--u) * 3); letter-spacing: 0.16em; color: #12151A; }

.soon-note { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--text-3); }
.end .soon-note { flex: 0 0 auto; }
.ep-list { display: flex; flex-direction: column; gap: 12px; }

/* Mensaje de chat (tipo WhatsApp, sin su logo) */
.chat { width: calc(var(--u) * 82); display: flex; flex-direction: column; gap: calc(var(--u) * 1.6); text-align: left; }
.chat.sent { align-items: flex-end; }
.chat.recv { align-items: flex-start; }
.chat-who { font-family: 'Inter', var(--body); font-size: calc(var(--u) * 3.2); font-weight: 600; color: #8696A0; letter-spacing: 0.02em; }
.chat.recv .chat-who { font-size: calc(var(--u) * 4.4); font-weight: 700; color: var(--naranja); letter-spacing: 0; }
.chat-bubble { position: relative; max-width: calc(var(--u) * 72); padding: calc(var(--u) * 2.8) calc(var(--u) * 3.6) calc(var(--u) * 2.2); border-radius: calc(var(--u) * 4.4); box-shadow: 0 calc(var(--u) * 3) calc(var(--u) * 10) rgba(0, 0, 0, 0.45); }
.chat.sent .chat-bubble { background: #005C4B; border-top-right-radius: calc(var(--u) * 1); }
.chat.recv .chat-bubble { background: #1F2C34; border-top-left-radius: calc(var(--u) * 1); }
.chat-text { font-family: 'Inter', var(--body); font-weight: 500; font-size: calc(var(--u) * 4.6); line-height: 1.32; color: #E9EDEF; text-wrap: pretty; }
.chat-meta { display: flex; justify-content: flex-end; margin-top: calc(var(--u) * 1); color: #8696A0; }
.chat-meta svg { width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); }
.chat-meta.read { color: #53BDEB; }
.chat-note { font-family: 'Inter', var(--body); font-size: calc(var(--u) * 3.2); color: #8696A0; }

/* Nota de voz que no carga ("Sin conexión") */
.card.is-offline .vn-bars i { background: #3A464E; }
.card.is-offline .vn-play { color: #8696A0; }
.card.is-offline .vn-play svg { animation: vn-spin 1.4s linear infinite; }
@keyframes vn-spin { to { transform: rotate(360deg); } }

/* Cierre de decisión (0.3): sin Hoja, el botón grande lleva a lo que sigue */
.end.is-decision { justify-content: center; text-align: center; gap: 18px; }
.end.is-decision .end-top { margin-top: 0; align-items: center; }
.end.is-decision .kicker { justify-content: center; }
.end.is-decision .next { align-items: center; gap: 10px; }
.end.is-decision .btn-block { min-height: 64px; padding: 0 14px; font-size: clamp(16px, 5.2cqw, 21px); font-weight: 800; letter-spacing: 0.01em; white-space: nowrap; }
.end .next .go-sub { font-family: var(--body); font-size: 14px; letter-spacing: 0; color: var(--text-2); }
.end.is-decision .btn-text { margin-top: 6px; font-size: 14px; color: var(--text-3); }

/* Cierre del episodio (dentro de la pantalla de la historia) */
.end { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(0deg, rgba(8, 9, 11, 0.97) 0%, rgba(8, 9, 11, 0.93) 62%, rgba(8, 9, 11, 0.78) 100%); }
.end-top { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.end .kicker { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--cian); }
.end .big { font-family: var(--display); font-weight: 900; font-size: 36px; line-height: 0.92; text-transform: uppercase; text-wrap: balance; }
.end .sub { font-size: 15px; line-height: 1.45; color: var(--text-2); }
.hoja-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--cian); background: rgba(0, 210, 255, 0.08); color: var(--text); text-align: left; cursor: pointer; flex: 0 0 auto; }
.hoja-btn:hover { background: rgba(0, 210, 255, 0.14); }
.hoja-btn .ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; background: var(--cian); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.hoja-btn b { display: block; font-size: 15px; }
.hoja-btn small { display: block; font-size: 13px; color: var(--text-3); }
.end .dl { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin-top: -6px; color: var(--cian); font-size: 14px; font-weight: 600; text-decoration: none; }
.end .sep { flex: 0 0 auto; height: 1px; background: var(--line); }
.end .next { display: flex; flex-direction: column; gap: 8px; }
.end .next small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--text-3); }
.end .next strong { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 0.95; text-transform: uppercase; }
.btn-block { width: 100%; border-radius: 8px; }
.end .btn-block { min-height: 52px; }
.btn-text { width: 100%; min-height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 15px; cursor: pointer; }
@container stage (max-height: 540px) {
  .end { gap: 10px; padding: 16px 16px 12px; }
  .end .sub { display: none; }
  .end .big { font-size: 30px; }
  .end .next strong { font-size: 24px; }
  .hoja-btn small { display: none; }
  .hoja-btn { min-height: 50px; }
  /* El cierre con botón grande (0.2 y 0.3) no lleva Hoja: sí cabe el texto */
  .end.is-decision .sub { display: block; font-size: 14px; }
}
@container stage (max-height: 420px) {
  .end.is-decision .sub { display: none; }
  .end { gap: 8px; padding: 12px 14px 8px; }
  .end .big { font-size: 24px; }
  .end .next small:not(.go-sub) { display: none; }
  .end .next strong { font-size: 20px; }
  .end .btn-block { min-height: 46px; }
  .btn-text { min-height: 34px; }
}

.soonbox { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: rgba(13, 15, 19, 0.9); }
.soonbox small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--cian); }
.soonbox strong { font-family: var(--display); font-weight: 900; font-size: 46px; line-height: 0.86; text-transform: uppercase; }
.soonbox .slot { width: 100%; max-width: 380px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 15px; color: var(--text-3); }
.btn-outline { min-height: 48px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; }

/* ---------- El reproductor de audio (tarjeta aparte) ---------- */
.deck { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.deck-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deck-cover { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--bg-2); }
.deck-cover-num { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); font-family: var(--display); font-weight: 900; font-size: 24px; color: var(--text); }
.deck-cover-num[hidden] { display: none; }
.deck-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.deck-meta small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--cian); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-meta b { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.deck-seek { display: flex; flex-direction: column; gap: 2px; }
.seek { position: relative; display: flex; align-items: center; width: 100%; height: 22px; cursor: pointer; touch-action: none; outline: none; }
.seek-track { display: block; width: 100%; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.18); }
.seek-fill { display: block; height: 100%; width: 0; background: var(--naranja); }
.seek-knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); pointer-events: none; }
.seek:focus-visible .seek-track { outline: 2px solid var(--cian); outline-offset: 4px; }
.deck-times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.deck-ctrls { display: flex; align-items: center; justify-content: center; gap: 36px; }
.dbtn { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dbtn:hover { background: rgba(255, 255, 255, 0.06); }
.dbtn text { font-family: var(--mono); font-size: 6.6px; font-weight: 700; text-anchor: middle; }
.dbtn-play { width: 64px; height: 64px; background: var(--naranja); color: var(--bg); box-shadow: 0 8px 24px rgba(255, 94, 19, 0.3); }
.dbtn-play:hover { background: var(--naranja); filter: brightness(1.08); }
.dbtn-play .i-pause, .dbtn-play.is-playing .i-play { display: none; }
.dbtn-play.is-playing .i-pause { display: block; }
.dbtn:disabled { opacity: 0.35; cursor: default; filter: none; box-shadow: none; }
.deck.is-off .seek { opacity: 0.35; cursor: default; }

/* ---------- La Hoja en carrusel ---------- */
.viewer { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; background: #08090B; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(12px, 3vw, 24px); border-bottom: 1px solid var(--line-soft); }
.viewer-head div { min-width: 0; }
.viewer-head small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--cian); }
.viewer-head b { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-close { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.viewer-body { position: relative; flex: 1 1 auto; min-height: 0; }
.viewer .track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.viewer .track::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: 16px; }
.page img { max-width: 100%; max-height: 100%; height: auto; width: auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); background: var(--card); }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(18, 21, 26, 0.85); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav:disabled { opacity: 0.3; cursor: default; }
.nav.prev { left: clamp(8px, 3vw, 32px); }
.nav.next { right: clamp(8px, 3vw, 32px); }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(12px, 3vw, 24px) max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }
.counter { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.foot-nav { display: flex; align-items: center; gap: 6px; }
.nav-sm { display: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); align-items: center; justify-content: center; cursor: pointer; }
.nav-sm:disabled { opacity: 0.3; cursor: default; }
/* En el celular las flechas bajan junto al contador, para no tapar la página */
@media (max-width: 700px) {
  .viewer-body .nav { display: none; }
  .nav-sm { display: flex; }
  .counter { min-width: 58px; text-align: center; }
  .page { padding: 12px 12px 8px; }
}
.viewer-foot .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }

/* ---------- Panel de la serie ---------- */
.panel { flex: 1 1 440px; min-width: 0; max-width: 640px; display: flex; flex-direction: column; gap: 28px; }
.ep-head { display: flex; flex-direction: column; gap: 14px; }
.ep-head .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--text-3); }
.ep-head h1 { font-family: var(--display); font-weight: 900; font-size: clamp(46px, 5.4vw, 76px); line-height: 0.86; text-transform: uppercase; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .tag { padding: 5px 10px; }
.ep-head .syn { font-size: 18px; line-height: 1.6; color: var(--text-3); text-wrap: pretty; }

.hoja { display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 2.4vw, 28px); border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.hoja .k { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--cian); }
.hoja h2 { margin-top: 10px; font-family: var(--display); font-weight: 900; font-size: clamp(36px, 3.4vw, 46px); line-height: 0.9; text-transform: uppercase; }
.hoja .intro-p { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--text-3); text-wrap: pretty; }
.stat { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--bg-2); }
.stat b { flex: 0 0 auto; font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 0.8; color: var(--naranja); }
.stat span { font-size: 15px; line-height: 1.45; color: var(--text-2); }
.stat strong, .hoja-list strong { color: var(--text); font-weight: 700; }
.hoja-ep1 { display: flex; flex-direction: column; gap: 18px; }
.hoja-list { display: flex; flex-direction: column; gap: 12px; }
.hoja-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.hoja-list svg { flex: 0 0 auto; margin-top: 2px; }
.placeholder { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 15px; color: var(--text-3); }
.hoja-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hoja-actions .btn { flex: 1 1 200px; min-height: 56px; border-radius: 8px; font-size: 16px; }
.btn-cian { background: var(--cian); color: var(--bg); }
.btn-cian:hover { color: var(--bg); filter: brightness(1.08); }
.btn-cian-line { background: transparent; border: 1px solid var(--cian); color: var(--cian); }
.btn-cian-line:hover { color: var(--cian-hover); }

.eps { display: flex; flex-direction: column; gap: 12px; }
.eps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.eps-head h2 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; text-transform: uppercase; }
.eps-head span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-4); white-space: nowrap; }
.ep-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-align: left; }
button.ep-row { cursor: pointer; font-family: var(--body); }
.ep-row.is-current { border-color: var(--naranja); background: rgba(255, 94, 19, 0.08); }
.ep-row.is-locked { border-color: var(--line-soft); background: transparent; }
.ep-row .thumb { flex: 0 0 auto; width: 54px; height: 96px; border-radius: 6px; object-fit: cover; }
.ep-row .thumb-num { flex: 0 0 auto; width: 54px; height: 96px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 900; font-size: 30px; }
.ep-row.is-locked .thumb-num { border-color: var(--line-soft); color: #5A6270; }
.ep-row .meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ep-row .meta small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--text-4); }
.ep-row .meta b { font-size: 18px; font-weight: 600; }
.ep-row.is-locked .meta b { color: var(--text-3); }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.status.now { color: var(--naranja); }
.status.now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.seen { color: var(--cian); gap: 6px; }
.status.lock { color: var(--text-4); font-weight: 400; gap: 6px; }

.t1 { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--bg-2); }
.t1 .lock { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-4); display: flex; align-items: center; justify-content: center; }
.t1 div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t1 small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--cian); }
.t1 strong { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; }
.t1 span { font-size: 14px; color: var(--text-4); }
.t1 .t1-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 2px; color: var(--cian); font-size: 15px; font-weight: 600; text-decoration: none; }
.t1 .t1-link:hover { color: var(--cian-hover); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .app-main { padding: 0 0 72px; gap: 28px; }
  /* En el celular, la historia y el reproductor caben juntos en la pantalla */
  .player-col { --colw: min(100vw, 430px); --gap: 14px; flex: 0 0 100%; width: 100%; max-width: 430px; margin: 0 auto; padding: 12px 16px; gap: var(--gap); position: static; height: max(min(calc(100vh - var(--top, 61px)), calc((var(--colw) - 32px) * 16 / 9 + 24px + var(--gap) + 176px)), 480px); height: max(min(calc(100svh - var(--top, 61px)), calc((var(--colw) - 32px) * 16 / 9 + 24px + var(--gap) + 176px)), 480px); }
  .stage { border-radius: 16px; box-shadow: none; max-height: calc((var(--colw) - 32px) * 16 / 9); }
  .deck { padding: 12px 14px 10px; gap: 6px; border-radius: 14px; }
  .deck-cover { width: 44px; height: 44px; border-radius: 7px; }
  .deck-meta b { font-size: 16px; }
  .deck-ctrls { gap: 30px; }
  .dbtn-play { width: 58px; height: 58px; }
  .panel { padding-inline: 20px; max-width: 640px; }
  .iab { margin-top: 0; padding: 12px 12px 0; }
}

/* Aviso chiquito al querer adelantar la primera vez */
.seek-note { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--text-3); text-align: center; }
.seek-note[hidden] { display: none; }
