/* v6: a slimmer story HUD, the lifeline worked into its stat, the portrait and speech in their own space,
   the journey back through time, and replay buttons */

/* ---------- story: the header and the six stats, smaller ---------- */
.st-top { height: calc(3.3rem + env(safe-area-inset-top)); padding-top: calc(.45rem + env(safe-area-inset-top)); gap: .5rem; }
.st-top img { width: 2.3rem; height: 2.3rem; }
.st-top b { font-size: .98rem; }
.st-top small { font-size: .72rem; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-top > div { min-width: 0; }
.stats { gap: .55rem .36rem; padding: .55rem .8rem .2rem; row-gap: .55rem; }
.stat { padding: .3rem .42rem .24rem; border-radius: .25rem; }
.stat .ic { font-size: .74rem; gap: .2rem; }
.stat svg { width: .85rem; height: .85rem; }
.stat .v { font-size: .98rem; }
.stat .bar2 { height: .2rem; margin-top: .12rem; }
.delta { font-size: .95rem; }

/* the lifeline: no floating badge — its stat is drawn in crimson, named on its top frame like a legend
   (between the name and the number), with a heartbeat */
.stat.key { border-color: rgba(214, 92, 70, .75); background: linear-gradient(180deg, rgba(58, 12, 9, .86), rgba(18, 8, 6, .86)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.stat.key svg { fill: #ff9f86; }
.stat.key .ic { color: #ffd9cf; }
.stat.key .bar2 { background: rgba(255, 120, 100, .14); }
.stat.key .bar2 i { background: linear-gradient(90deg, #8e231b, #ff7a5c); box-shadow: 0 0 6px rgba(255, 100, 80, .55); animation: lifeBeat 1.6s ease-in-out infinite; }
.stat em.life { left: 50%; right: auto; top: -.48rem; transform: translateX(-50%); padding: 0 .32rem; border: 0; border-radius: 0; box-shadow: none;
  font-size: .64rem; font-weight: 600; line-height: .9rem; letter-spacing: .12em; color: #ff9f86; text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, transparent 50%, #2a0d09 50%); }
.stat em.life::before { content: "♥"; margin-right: .18rem; font-size: .6rem; letter-spacing: 0; display: inline-block; animation: lifeHeart 1.6s ease-in-out infinite; }
.stat.key.top { box-shadow: 0 0 10px rgba(226, 199, 142, .35); }
.stat.warn { border-color: #ff5a46; }
.stat.warn em.life { color: #ffd0c4; }
.stat.warn em.life::before { animation-duration: .7s; }
@keyframes lifeBeat { 0%, 100% { filter: brightness(1); } 12% { filter: brightness(1.6); } 24% { filter: brightness(1); } 36% { filter: brightness(1.35); } }
@keyframes lifeHeart { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.35); } 24% { transform: scale(1); } 36% { transform: scale(1.2); } }

/* ---------- the stage: the portrait and the speech take the free space, never the text card's ---------- */
.st-main { padding-top: .2rem; }
.st-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: .3rem 0 .5rem; }
#st-sub.subtitle.top { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: 100%; flex: none; display: none; z-index: 2 !important; }
.st-stage.talk #st-sub.subtitle.top { display: block; }
.st-stage .st-portrait { position: relative; left: auto; bottom: auto; transform: none; flex: none; width: auto; height: min(9.4rem, 19vh); }
.st-stage .st-portrait.on { animation: ptIn6 .7s cubic-bezier(.2, 1.4, .4, 1) both, ptGlow 3.2s ease-in-out .7s infinite; }
@keyframes ptIn6 { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }
.st-tl { margin: 0 0 .55rem; padding: .28rem .65rem; }
.tl-y { font-size: .7rem; }
.st-tagrow { margin-bottom: .6rem; }
.tag { font-size: .74rem; padding: .18rem .62rem; }
#st-act { font-size: .74rem; }
.st-card { min-height: 7.5rem; max-height: 40vh; }
.st-card h3 { font-size: 1.02rem; margin-bottom: .3rem; }
.choices { margin-top: .9rem; }
/* no hints of what a choice does: the stats move only once it is made */
.choice .fx { display: none !important; }

/* ---------- the journey back through time ---------- */
#cine .cine-art.g-warp { filter: sepia(.6) saturate(.6) brightness(.22) blur(5px); }
.warp { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.warp.on { opacity: 1; }
.warp-rings, .warp-dial, .warp-mid { display: none; }
.warp.spin .warp-rings, .warp.spin .warp-dial, .warp.spin .warp-mid { display: block; }
/* rings closing in on the centre: falling back through the years */
.warp-rings i { position: absolute; left: 50%; top: 40%; width: 34rem; height: 34rem; margin: -17rem 0 0 -17rem; border-radius: 50%;
  border: 1px solid rgba(226, 199, 142, .5); box-shadow: 0 0 22px rgba(226, 199, 142, .25), inset 0 0 22px rgba(226, 199, 142, .15);
  opacity: 0; animation: ringIn 1.5s cubic-bezier(.55, 0, .8, .4) infinite; }
.warp-rings i:nth-child(2) { animation-delay: .5s; }
.warp-rings i:nth-child(3) { animation-delay: 1s; }
@keyframes ringIn { 0% { transform: scale(1.3); opacity: 0; } 25% { opacity: .9; } 100% { transform: scale(.05); opacity: 0; } }
/* the clock: a gold ring with twelve marks, hands spinning backwards and slowing to a stop */
.warp-dial { position: absolute; left: 50%; top: 40%; width: 13rem; height: 13rem; margin: -6.5rem 0 0 -6.5rem; border-radius: 50%;
  border: 1px solid var(--hl); box-shadow: 0 0 0 .45rem rgba(10, 7, 5, .55), 0 0 0 calc(.45rem + 1px) rgba(226, 199, 142, .3), 0 0 50px rgba(226, 199, 142, .2), inset 0 0 40px rgba(0, 0, 0, .8);
  background: radial-gradient(circle, rgba(30, 21, 12, .85) 0%, rgba(8, 6, 4, .9) 70%); animation: dialIn .8s cubic-bezier(.2, 1.3, .4, 1) both; }
.warp-dial::before { content: ""; position: absolute; inset: .55rem; border-radius: 50%;
  background: repeating-conic-gradient(from -1.5deg, rgba(244, 227, 184, .85) 0deg 3deg, transparent 3deg 30deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 84%, #000 85%); mask: radial-gradient(circle closest-side, transparent 84%, #000 85%); }
.warp-dial::after { content: ""; position: absolute; left: 50%; top: 50%; width: .6rem; height: .6rem; margin: -.3rem 0 0 -.3rem; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 10px rgba(244, 227, 184, .8); }
.warp-dial i { position: absolute; left: 50%; bottom: 50%; transform-origin: 50% 100%; border-radius: 1px; background: linear-gradient(0deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 8px rgba(244, 227, 184, .6); }
.warp-dial i.h { width: .22rem; height: 3.6rem; margin-left: -.11rem; animation: handBack 3.3s cubic-bezier(.3, .1, .2, 1) both; }
.warp-dial i.m { width: .12rem; height: 5.3rem; margin-left: -.06rem; animation: handBack2 3.3s cubic-bezier(.3, .1, .2, 1) both; }
@keyframes dialIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes handBack { from { transform: rotate(40deg); } to { transform: rotate(-1040deg); } }
@keyframes handBack2 { from { transform: rotate(180deg); } to { transform: rotate(-6300deg); } }
.warp.land .warp-dial { box-shadow: 0 0 0 .45rem rgba(10, 7, 5, .55), 0 0 0 calc(.45rem + 1px) rgba(244, 227, 184, .6), 0 0 80px rgba(244, 227, 184, .45), inset 0 0 40px rgba(0, 0, 0, .8); transition: box-shadow .3s ease; }
/* the year rolling back */
.warp-mid { position: absolute; left: 0; right: 0; top: calc(40% + 8.3rem); text-align: center; }
#warp-lbl { display: block; font-size: .8rem; font-weight: 500; letter-spacing: .5em; margin-right: -.5em; color: var(--muted); }
#warp-year { display: block; margin-top: .45rem; font-size: 2.5rem; font-weight: 600; letter-spacing: .06em; line-height: 1.15; color: var(--gold-hi);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(226, 199, 142, .45), 0 2px 6px #000; }
.warp.land #warp-year { animation: yearLand .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes yearLand { from { transform: scale(1.25); } to { transform: none; } }
/* a white flash at the arrival */
.warp::after { content: ""; position: absolute; inset: 0; background: #fff6e0; opacity: 0; }
.warp.flash::after { animation: warpFlash .9s ease-out both; }
@keyframes warpFlash { 0% { opacity: 0; } 25% { opacity: .9; } 100% { opacity: 0; } }
/* "When you wake… you have become <name>" */
.warp-wake { position: absolute; left: 8%; right: 8%; top: calc(15% + 13.6rem); display: none; text-align: center; }
.warp.wake .warp-wake { display: block; }
.warp-wake .wl { display: block; opacity: 0; transform: translateY(8px); filter: blur(4px); transition: opacity 1s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1), filter 1s ease; }
.warp-wake .wl.on { opacity: 1; transform: none; filter: none; }
.warp-wake .a { font-size: 1.05rem; font-weight: 500; letter-spacing: .3em; color: var(--muted); margin-bottom: .9rem; }
.warp-wake .b { font-size: 1rem; font-weight: 500; letter-spacing: .2em; color: var(--text); }
.warp-wake .nm { margin: .3rem 0 .35rem; font-size: 2.1rem; font-weight: 700; letter-spacing: .08em; line-height: 1.25; color: var(--gold-hi); text-shadow: 0 0 26px rgba(226, 199, 142, .45), 0 2px 6px #000; }
.warp-wake .rl { margin-top: .4rem; font-size: .9rem; line-height: 1.5; letter-spacing: .06em; color: #dccdaa; }
.warp-wake .rule { display: flex; align-items: center; gap: .6rem; width: 60%; margin: .8rem auto .6rem; font-size: .5rem; color: var(--gold); }
.warp-wake .rule::before, .warp-wake .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--hl)); }
.warp-wake .rule::after { background: linear-gradient(90deg, var(--hl), transparent); }
.warp-wake .rule i { font-style: normal; }
.warp-wake .when { font-size: .86rem; font-weight: 500; letter-spacing: .14em; line-height: 1.5; color: var(--gold); }
#cine.film-warp .film-pt { top: 15%; width: 9.6rem; }

/* ---------- replay buttons ---------- */
.btn i.play { display: inline-block; width: 0; height: 0; margin-right: .55rem; border-style: solid; border-width: .38rem 0 .38rem .62rem; border-color: transparent transparent transparent currentColor; }
.replay-btn { margin: .7rem auto .1rem; width: fit-content; min-width: 60%; }
.en-replay { display: inline-flex; margin: .7rem auto 0; min-height: 2.9rem; padding: .3rem 1.1rem; font-size: .88rem; }
