/* SARAH'S MORTOROLA G-SPOT — her own phone (ch 98, Phil's, Day 16).
   js/dialogue-scenes/scene-sarah-mortorola.js. Budget Android, bought
   for cash: thick bezels, a chin with the wordmark, a cracked corner,
   a smoky case sticker-bombed on the back, a 3.5 mm jack with the
   wired earbuds she shares. Sized off the zoomed viewport (--vh100). */

#srmStage {
  position: fixed; left: 0; top: 0;
  width: var(--vw100, 100vw); height: var(--vh100, 100vh);
  z-index: 9990; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0 205px; box-sizing: border-box;
  opacity: 0; transition: opacity .45s ease;
  font-family: 'Courier New', Courier, monospace;
}
#srmStage.srm-on { opacity: 1; }
#srmStage .srm-dim {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 46%, rgba(20,14,16,.35) 0%, rgba(10,7,8,.78) 72%, rgba(6,4,5,.9) 100%);
}
#srmStage.srm-ear .srm-dim {
  background: radial-gradient(ellipse at 42% 70%, rgba(26,12,16,.55) 0%, rgba(8,5,6,.9) 70%, rgba(4,3,3,.96) 100%);
}

/* ── the phone ─────────────────────────────────────────── */
.srm-holder { position: relative; perspective: 1400px; transition: transform .7s cubic-bezier(.2,.8,.25,1); }
.srm-phone {
  --ph: min(calc(var(--vh100, 100vh) - 300px), 500px);
  position: relative; height: var(--ph); width: calc(var(--ph) * .49);
  transform-style: preserve-3d; transition: transform .85s cubic-bezier(.3,.75,.25,1);
  transform: rotateY(0deg) rotateZ(-3deg);
}
.srm-phone.srm-front-up { transform: rotateY(180deg) rotateZ(3deg); }
.srm-face {
  position: absolute; inset: 0; border-radius: 9% / 4.4%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 26px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
}
.srm-front { transform: rotateY(180deg); background: linear-gradient(160deg, #26262b 0%, #141417 55%, #0d0d0f 100%); }
.srm-back  { background: linear-gradient(150deg, #2c2730 0%, #1b181d 60%, #121014 100%); overflow: hidden; }

/* the case: smoky, scuffed, the stickers are on it */
.srm-back::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(ellipse at 30% 18%, rgba(255,255,255,.07), transparent 46%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 3px, transparent 3px 7px);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.45), inset 0 0 22px rgba(0,0,0,.6);
}
.srm-cam {
  position: absolute; left: 8%; top: 3.6%; width: 25%; aspect-ratio: 1 / 1.25;
  border-radius: 22%; background: linear-gradient(145deg, #1c1b1f, #0b0b0c);
  box-shadow: inset 0 0 0 2px #2d2b31, 0 2px 6px rgba(0,0,0,.6);
}
.srm-cam i { position: absolute; left: 18%; top: 12%; width: 64%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #3c4f66 0%, #0e1218 45%, #030405 70%); box-shadow: inset 0 0 0 3px #232227; }
.srm-cam b { position: absolute; left: 38%; bottom: 8%; width: 24%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff8e0, #b9a77a 60%, #5c5340); opacity: .8; }
.srm-logo { position: absolute; left: 50%; top: 19%; width: 17%; transform: translateX(-50%); opacity: .55; }
.srm-logo svg { width: 100%; display: block; }
.srm-word { position: absolute; left: 0; right: 0; bottom: 6.5%; text-align: center;
  font-size: 9px; letter-spacing: 3px; color: rgba(210,205,215,.45); }
.srm-word em { display: block; font-size: 8px; letter-spacing: 1px; font-style: italic; color: rgba(232,72,110,.5); }
.srm-stk { position: absolute; display: block; height: auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)) saturate(.92); }
.srm-stk.peel { clip-path: polygon(0 0, 100% 0, 100% 84%, 86% 100%, 0 100%); }
.srm-casecrack { position: absolute; right: 0; bottom: 0; width: 34%; opacity: .5; }

/* front: bezel, screen, chin */
.srm-earpiece { position: absolute; top: 2.3%; left: 38%; width: 24%; height: .55%; border-radius: 4px; background: #050506; box-shadow: inset 0 1px 1px rgba(255,255,255,.06); }
.srm-frontcam { position: absolute; top: 2%; left: 66%; width: 2.6%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #304458, #050608 65%); }
.srm-screen {
  position: absolute; left: 3.8%; right: 3.8%; top: 5.2%; bottom: 7.4%;
  border-radius: 7px; overflow: hidden; background: #050506;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.9);
}
.srm-chin { position: absolute; left: 0; right: 0; bottom: 2.2%; text-align: center;
  font-size: 9px; letter-spacing: 4px; color: rgba(190,188,196,.42); }
.srm-crack { position: absolute; left: 0; top: 0; width: 46%; pointer-events: none; z-index: 30; mix-blend-mode: screen; opacity: .8; }
.srm-chip { position: absolute; left: -1px; top: -1px; width: 9%; aspect-ratio: 1; border-top-left-radius: 70%;
  background: linear-gradient(135deg, #5b5a60, #2a292d 60%); clip-path: polygon(0 0, 100% 0, 0 100%); opacity: .9; }
.srm-jack { position: absolute; top: -3px; left: 26%; width: 5.5%; height: 5px; border-radius: 3px; background: #050506; box-shadow: 0 0 0 1px #2c2b30; }
.srm-wire { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

/* status bar */
.srm-status { position: absolute; left: 0; right: 0; top: 0; height: 18px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; padding: 0 7px;
  font: 600 9px/1 Arial, sans-serif; color: rgba(255,255,255,.88);
  background: linear-gradient(rgba(0,0,0,.5), transparent); }
.srm-status .r { display: flex; gap: 4px; align-items: center; }
.srm-status .vpn { font-size: 7px; border: 1px solid rgba(255,255,255,.7); border-radius: 2px; padding: 0 2px; }
.srm-status .nosim { font-size: 7px; opacity: .7; }

/* home */
.srm-home { position: absolute; inset: 0; padding: 30px 10px 0;
  background: radial-gradient(circle at 50% 30%, #3a1420 0%, #140a0e 60%, #0a0608 100%);
  display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 12px 4px;
  transition: opacity .35s ease; }
.srm-home .wall { position: absolute; left: 50%; top: 52%; width: 58%; transform: translate(-50%,-50%) rotate(-4deg); opacity: .3; }
.srm-app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: 600 7.5px/1.1 Arial, sans-serif; color: rgba(255,255,255,.85); text-align: center; }
.srm-app .ic { width: 70%; aspect-ratio: 1; border-radius: 22%; overflow: hidden; display: block;
  box-shadow: 0 2px 5px rgba(0,0,0,.5); background: #222; }
.srm-app .ic img, .srm-app .ic svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.srm-app.tap .ic { animation: srmTap .45s ease; }
@keyframes srmTap { 40% { transform: scale(.82); filter: brightness(1.4); } }

/* DikDok feed */
.srm-dik { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .3s ease; }
.srm-dik.on { opacity: 1; }
.srm-track { position: absolute; inset: 0; transition: transform .55s cubic-bezier(.3,.8,.3,1); }
.srm-track.fast { transition-duration: .22s; }
.srm-item { position: absolute; left: 0; right: 0; height: 100%; overflow: hidden; background: #000; }
.srm-item video, .srm-item img.media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.srm-tabs { position: absolute; top: 20px; left: 0; right: 0; text-align: center; z-index: 6;
  font: 700 9px/1 Arial, sans-serif; color: rgba(255,255,255,.6); letter-spacing: .2px; }
.srm-tabs b { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; margin-left: 8px; }
.srm-rail { position: absolute; right: 5px; bottom: 58px; z-index: 6; display: flex; flex-direction: column; gap: 9px; align-items: center;
  font: 700 7.5px/1.1 Arial, sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.srm-rail .av { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #fff; background-size: cover; background-position: center; }
.srm-rail span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.srm-rail i { font-style: normal; font-size: 15px; line-height: 1; }
.srm-rail svg { display: block; }
.srm-ear-ui .ctl svg { display: block; }
.srm-cap { position: absolute; left: 7px; right: 40px; bottom: 26px; z-index: 6;
  font: 9px/1.3 Arial, sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
.srm-cap b { display: block; font-size: 9.5px; margin-bottom: 2px; }
.srm-cap .snd { display: block; margin-top: 3px; font-size: 8px; opacity: .85; white-space: nowrap; overflow: hidden; }
.srm-nav { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; z-index: 7; background: #000;
  display: flex; justify-content: space-around; align-items: center; font: 700 7px/1 Arial, sans-serif; color: rgba(255,255,255,.75); }
.srm-nav .plus { width: 22px; height: 13px; border-radius: 3px; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; font-size: 11px;
  box-shadow: -2px 0 0 #3fd1e6, 2px 0 0 #ff3b6b; }
.srm-blur .srm-item { filter: blur(3px) brightness(.85); }

/* Eargasm, wired */
.srm-ear-ui { position: absolute; inset: 0; padding: 24px 12px 10px; opacity: 0; transition: opacity .35s ease;
  background: linear-gradient(180deg, #5a1222 0%, #24090f 46%, #0d0d0d 78%);
  display: flex; flex-direction: column; align-items: center; color: #fff; font-family: Arial, sans-serif; }
.srm-ear-ui.on { opacity: 1; }
.srm-ear-ui .hd { width: 100%; display: flex; justify-content: space-between; font-size: 7.5px; letter-spacing: 1px; opacity: .75; text-transform: uppercase; }
.srm-ear-ui .art { width: 78%; aspect-ratio: 1; margin: 12px 0 10px; border-radius: 4px; background: #1a0b0f center/86% no-repeat;
  box-shadow: 0 10px 26px rgba(0,0,0,.6); }
.srm-ear-ui .ti { align-self: flex-start; font-weight: 700; font-size: 12px; }
.srm-ear-ui .ar { align-self: flex-start; font-size: 9px; opacity: .7; margin-top: 2px; }
.srm-ear-ui .bar { width: 100%; height: 3px; border-radius: 2px; background: rgba(255,255,255,.22); margin: 12px 0 4px; position: relative; }
.srm-ear-ui .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: #1db954; }
.srm-ear-ui .bar b { position: absolute; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: translateX(-50%); }
.srm-ear-ui .tm { width: 100%; display: flex; justify-content: space-between; font-size: 7.5px; opacity: .7; }
.srm-ear-ui .ctl { display: flex; gap: 16px; align-items: center; margin-top: 8px; font-size: 13px; }
.srm-ear-ui .ctl .pp { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.srm-ear-ui .wired { margin-top: auto; font-size: 7.5px; letter-spacing: 1px; color: #1db954; opacity: .9; }
.srm-ear-ui .ml { font-size: 7px; opacity: .5; margin-top: 2px; }

/* the earbud scene: phone low, under the table edge */
#srmStage.srm-ear .srm-holder { transform: translate(-16%, 4%) scale(.86) rotate(-9deg); }
#srmStage .srm-tableedge { position: absolute; left: 0; right: 0; top: 0; height: 30%; pointer-events: none;
  background: linear-gradient(180deg, rgba(48,30,22,.95) 0%, rgba(34,20,14,.92) 70%, rgba(0,0,0,0) 100%);
  border-bottom: 2px solid rgba(196,168,122,.18); opacity: 0; transition: opacity .5s ease; }
#srmStage.srm-ear .srm-tableedge { opacity: 1; }
#srmStage .srm-line { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#srmStage.srm-leave .srm-holder { transform: translate(-14%, 80%) scale(.7) rotate(-14deg); transition-duration: .5s; }
#srmStage.srm-yank .srm-holder { transform: translateY(95%) rotate(8deg) scale(.9); transition-duration: .32s; transition-timing-function: cubic-bezier(.6,0,.8,.4); }
