* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: #000; color: #fff; }
body { font-family: system-ui, sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible { outline: 2px solid #fff0ae; outline-offset: -3px; border-radius: 12px; }
#app { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; display: grid; place-items: center; }
.stage { position: relative; width: min(100vw, 56.25vh); height: min(100vh, 177.7778vw); width: min(100vw, 56.25dvh); height: min(100dvh, 177.7778vw); aspect-ratio: 9/16; background: #000; overflow: hidden; animation: reveal 1.25s ease both; }
@keyframes reveal { from {opacity:0;} to {opacity:1;} }
.scene { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .32s ease; }
.scene.active { opacity: 1; pointer-events: auto; z-index: 1; }
.scene video { display: block; width:100%; height:100%; object-fit:contain; pointer-events:none; }
.hit { position:absolute; border:0; background:transparent; padding:0; }
.flame { left:31%; top:24%; width:38%; height:20%; border-radius:50%; }
.touch-hint { left:7%; top:90%; width:86%; height:7%; }
.entire { inset:0; width:100%; height:100%; }
.mic-area { position:absolute; top:19.1%; left:4%; right:4%; text-align:center; z-index:2; pointer-events:none; }
.mic { pointer-events:auto; display:inline-flex; align-items:center; gap:7px; padding:7px 12px; border:1px solid #88794d; border-radius:100px; background:#13110d; color:#f8e9ba; font-size:clamp(11px,3.2vw,14px); line-height:1.2; }
.mic[disabled] { cursor:default; opacity:.72; }
.mic[hidden] { display:none; }
#micStatus { margin:3px 0 0; color:#ddd1b1; font-size:clamp(10px,2.7vw,12px); line-height:1.2; }
.resume { position:absolute; z-index:5; bottom:10%; left:50%; transform:translateX(-50%); border:1px solid #a79877; background:#1b1710; border-radius:30px; padding:10px 14px; white-space:nowrap; }
.resume[hidden] { display:none; }
.letter { position:absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(100vw, 56.25vh);height: min(100vh, 177.7778vw);width: min(100vw, 56.25dvh);height: min(100dvh, 177.7778vw); z-index:4; background:#e9d2ac url('assets/papel.png') center / 100% 100%; color:#412a19; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:contain; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .35s ease, visibility 0s linear .35s; -webkit-overflow-scrolling:touch; }
.letter.active { opacity:1; visibility:visible; pointer-events:auto; transition:opacity .35s ease; }
.letter-inner { width:100%; max-width:680px; min-height:100%; margin:0 auto; padding: max(42px,calc(env(safe-area-inset-top) + 22px)) clamp(24px,7vw,54px) max(42px,calc(env(safe-area-inset-bottom) + 22px)); display:flex; flex-direction:column; justify-content:center; }
.letter-text { font-family:Georgia,'Times New Roman',serif; font-size:clamp(18px,4.7vw,23px); line-height:1.65; overflow-wrap:anywhere; white-space:normal; opacity:0; transform:translateY(6px); }
.letter.active .letter-text { animation: ink .8s .18s ease forwards; }
.letter-text p { margin:0 0 1.15em; white-space:pre-wrap; }
.letter-text p:last-child { margin-bottom:0; }
.letter-text.single { text-align:center; font-size:clamp(24px,6.1vw,34px); }
@keyframes ink { to {opacity:1; transform:none;} }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (prefers-reduced-motion:reduce) { .stage,.scene,.letter,.letter-text { animation-duration:.01s !important; transition-duration:.01s !important; } .letter.active .letter-text {opacity:1;transform:none;} }
