/* =========================================================
 * Room view (camera), close-ups, door-lock keypad, climax (P8), H6 voice call
 * Owner: room-climax. Loaded after scenes.css (overrides the old room styles).
 * ========================================================= */

/* ---------------- room / camera ---------------- */
.room.rv { isolation: isolate; background: #000; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.rv-turn { position: absolute; inset: 0; }
.rv-turn.turn-r { animation: rvTurnR .42s cubic-bezier(.2,.9,.3,1); }
.rv-turn.turn-l { animation: rvTurnL .42s cubic-bezier(.2,.9,.3,1); }
@keyframes rvTurnR { from { filter: blur(8px) brightness(.35); transform: translateX(70px); } to { filter: none; transform: none; } }
@keyframes rvTurnL { from { filter: blur(8px) brightness(.35); transform: translateX(-70px); } to { filter: none; transform: none; } }
.rv-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: auto; }
.rv-dark, .rv-lit, .rv-glow, .rv-marks, .rv-layers { position: absolute; inset: 0; pointer-events: none; }
.rv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.rv-dark { filter: brightness(.13) contrast(1.15) saturate(.6); transition: filter .6s; }
.rv-lit { opacity: 0; filter: brightness(1.05) contrast(1.05) sepia(.12) saturate(.95); transition: opacity .18s; }
.room.flash-on .rv-lit { opacity: 1; }
.room.flash-on .rv-dark { filter: brightness(.085) contrast(1.1) saturate(.5); }
.rv-layer { position: absolute; display: block; pointer-events: none; opacity: 0; transition: opacity .2s; }
.rv-layer.ok { opacity: 1; }
.rv-layer.fingers.ok { opacity: .35; }

/* lit room after 비상벨 */
.room.lit-room .rv-dark { filter: brightness(1.02) contrast(1.02) saturate(.95); }
.room.lit-room .rv-lit { display: none; }
.room.lit-room .rv-vig { opacity: .35; }
.room.lit-room.lights-on .rv-dark { animation: rvLightsOn 2.6s ease-out; }
@keyframes rvLightsOn { 0% { filter: brightness(.1); } 14% { filter: brightness(2.6) contrast(.8) saturate(.5); } 40% { filter: brightness(1.5) contrast(.9); } 100% { filter: brightness(1.02) contrast(1.02) saturate(.95); } }

/* emitters (not darkened) */
.rv-led { position: absolute; width: .55%; height: .37%; margin: -.18% 0 0 -.27%; border-radius: 50%; background: #64b5ff; box-shadow: 0 0 calc(var(--fw, 500px) * .012) calc(var(--fw, 500px) * .004) rgba(80,160,255,.55); opacity: .75; animation: rvLed 3.2s ease-in-out infinite; }
@keyframes rvLed { 50% { opacity: .38; } }
.room.flash-on .rv-led { opacity: .4; animation: none; }
.rv-ringglow { position: absolute; opacity: 0; transform: scaleX(1.9); background: linear-gradient(90deg, transparent 0%, rgba(60,130,255,.28) 30%, rgba(175,220,255,.98) 50%, rgba(60,130,255,.28) 70%, transparent 100%); -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); filter: blur(1.5px); mix-blend-mode: screen; transition: opacity .25s ease-out; }
.rv-ringglow.on { opacity: calc(var(--rg, 0) * .95); }
.rv-glint { position: absolute; width: .3%; height: .2%; margin: -.1% 0 0 -.15%; border-radius: 50%; background: #f4f1e8; box-shadow: 0 0 3px 1px rgba(255,250,235,.6); opacity: .75; }
.rv-glint.flash { opacity: 1; }

/* door sticker (CSS fallback is real DOM text so it stays crisp at 8×) */
.rv-sticker { position: absolute; background: #f4f2ec; border-radius: 4%/8%; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0,0,0,.25); }
.rv-sticker.bare { background: transparent; box-shadow: none; }
.rv-sticker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rv-sticker.img .stk-fb { display: none; }
.stk-fb { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 3%; padding: 5% 4%; color: #1d2b4a; font-family: var(--font); font-size: calc(var(--fw, 500px) * .0042); line-height: 1.25; letter-spacing: -.02em; }
.stk-l { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; white-space: nowrap; }
.stk-l b { font-weight: 800; font-size: 1.12em; color: #0f3d8a; border-bottom: .12em solid #0f3d8a; padding-bottom: .1em; }
.stk-tel { font-weight: 800; font-size: 1.25em; color: #111; }
.stk-qrlbl { font-size: .82em; color: #b3261e; font-weight: 700; }
.stk-qr { flex: none; aspect-ratio: 1; height: 100%; background: #fff center/contain no-repeat; image-rendering: pixelated; }

/* QR detection brackets */
.rv-qrbr { position: absolute; opacity: 0; transition: opacity .2s; --b: calc(2.2px * var(--iz, 1)); }
.rv-qrbr i { position: absolute; width: 24%; height: 42%; border: 0 solid #ffd60a; filter: drop-shadow(0 0 calc(3px * var(--iz,1)) rgba(255,214,10,.6)); }
.rv-qrbr i:nth-child(1) { left: -8%; top: -22%; border-left-width: var(--b); border-top-width: var(--b); border-top-left-radius: calc(4px * var(--iz,1)); }
.rv-qrbr i:nth-child(2) { right: -8%; top: -22%; border-right-width: var(--b); border-top-width: var(--b); border-top-right-radius: calc(4px * var(--iz,1)); }
.rv-qrbr i:nth-child(3) { left: -8%; bottom: -22%; border-left-width: var(--b); border-bottom-width: var(--b); border-bottom-left-radius: calc(4px * var(--iz,1)); }
.rv-qrbr i:nth-child(4) { right: -8%; bottom: -22%; border-right-width: var(--b); border-bottom-width: var(--b); border-bottom-right-radius: calc(4px * var(--iz,1)); }
.rv-qrbr.show { opacity: 1; animation: rvQr 1.4s ease-in-out infinite; }
@keyframes rvQr { 50% { opacity: .55; } }

/* hotspots */
.rv-spot { position: absolute; border-radius: 10px; background: transparent; -webkit-tap-highlight-color: transparent; }
.rv-spot:active { background: rgba(255,255,255,.05); }
.rv-spot::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, calc(44px * var(--iz, 1))); height: max(100%, calc(44px * var(--iz, 1))); transform: translate(-50%, -50%); }
body.debug .rv-spot { outline: 1px dashed rgba(255,0,0,.75); }
.rv-spot.cx-pulse { border-radius: 50%; animation: cxSpot 1.6s ease-out infinite; }
@keyframes cxSpot { 0% { box-shadow: 0 0 0 0 rgba(255,214,10,.55), inset 0 0 0 calc(1.5px * var(--iz,1)) rgba(255,214,10,.8); } 100% { box-shadow: 0 0 0 calc(18px * var(--iz,1)) rgba(255,214,10,0), inset 0 0 0 calc(1.5px * var(--iz,1)) rgba(255,214,10,.2); } }

/* chrome */
.rv-vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 75% at 50% 48%, transparent 55%, rgba(0,0,0,.55) 100%); }
.rv-top { z-index: 3; }
.rv-topr { display: flex; gap: 10px; }
.rv-flash.nudge { animation: rvNudge .9s ease-out 2; }
@keyframes rvNudge { 0%,100% { transform: none; box-shadow: 0 0 0 0 rgba(255,214,10,.0); } 30% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(255,214,10,.25); } }
.rv-label { min-width: 48px; text-align: center; transition: background .2s; }
.rv-dirs { z-index: 2; }
.rv-turnbtn { z-index: 2; transition: opacity .2s; }
.room.zoomed .rv-turnbtn { opacity: .35; }
.rv-hint { top: calc(var(--sb-h) + 112px); bottom: auto; }

.rv-bottom { z-index: 3; }
.rv-zoom { display: flex; justify-content: center; gap: 6px; margin: 0 auto 14px; padding: 4px; width: max-content; border-radius: 22px; background: rgba(0,0,0,.45); }
.rv-zoom button { min-width: 38px; height: 38px; padding: 0 6px; border-radius: 19px; color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: -.2px; background: rgba(255,255,255,.08); transition: background .2s, color .2s, transform .2s; }
.rv-zoom button.on { background: rgba(0,0,0,.6); color: #ffd60a; transform: scale(1.06); font-size: 13px; }
.rv-shutter { position: relative; touch-action: none; }
.rv-shutter .rv-moon { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #1b1b1b; }
.rv-shutter .rv-moon svg { width: 26px; height: 26px; }
.rv-shutter.night i { background: #ffd60a; }
.rv-shutter.night .rv-moon { display: flex; }

.rv-chip { position: absolute; left: 50%; z-index: 4; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px; border-radius: 18px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(20,20,22,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transform: translate(-50%, 8px) scale(.96); transition: opacity .22s, transform .3s cubic-bezier(.2,.9,.3,1); white-space: nowrap; }
.rv-chip svg { width: 17px; height: 17px; flex: none; }
.rv-chip.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.rv-night { top: calc(var(--sb-h) + 96px); color: #ffd60a; }
.rv-night.on { background: #ffd60a; color: #111; }
.rv-qr { bottom: calc(var(--safe-bot) + 206px); background: rgba(255,255,255,.92); color: #111; box-shadow: 0 6px 22px rgba(0,0,0,.4); }
.rv-qr span { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.rv-knock { position: absolute; z-index: 4; right: 14px; bottom: calc(var(--safe-bot) + 206px); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; padding: 9px 0 7px; border-radius: 18px; color: #eee; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); font-size: 11px; letter-spacing: -.2px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .25s, transform .3s; }
.rv-knock svg { width: 28px; height: 28px; }
.rv-knock.show { opacity: 1; pointer-events: auto; transform: none; }
.rv-knock.hit svg { animation: rvKnock .18s ease-out; }
@keyframes rvKnock { 40% { transform: translateX(-5px) rotate(-8deg); } }
.rv-caption { position: absolute; z-index: 4; left: 22px; right: 22px; bottom: calc(var(--safe-bot) + 262px); text-align: center; font-family: var(--serif); font-size: calc(15px * var(--ts, 1)); line-height: 1.6; color: #eee; text-shadow: 0 1px 2px #000, 0 0 14px rgba(0,0,0,.9); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; pointer-events: none; word-break: keep-all; }
.rv-caption.in { opacity: 1; transform: none; }
.room.lit-room .rv-caption, .room.zoomed .rv-caption { left: 50%; right: auto; width: max-content; max-width: calc(100% - 44px); transform: translate(-50%, 6px); padding: 8px 14px; border-radius: 12px; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.room.lit-room .rv-caption.in, .room.zoomed .rv-caption.in { transform: translate(-50%, 0); }
.room.night-armed .rv-dark { filter: brightness(.2) contrast(1.05) saturate(.2); }

/* night capture ring + processing */
.rv-nring { position: absolute; z-index: 6; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; transition: opacity .25s, transform .3s; pointer-events: none; }
.rv-nring.in { opacity: 1; transform: translate(-50%, -50%); }
.rv-nring.shake { animation: wrongShake .4s; }
.nr-circle { position: relative; width: 96px; height: 96px; }
.nr-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.nr-circle circle { fill: rgba(0,0,0,.35); stroke-width: 5; }
.nr-circle .bg { stroke: rgba(255,255,255,.22); }
.nr-circle .fg { stroke: #ffd60a; fill: none; stroke-linecap: round; }
.nr-circle b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: #ffd60a; }
.nr-text { font-size: 14px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000; }
.nr-sub { font-size: 12px; color: rgba(255,255,255,.7); }
.rv-proc { position: absolute; z-index: 6; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 20px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s; }
.rv-proc.in { opacity: 1; }
.rv-proc i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #ffd60a; animation: rvSpin .7s linear infinite; }
@keyframes rvSpin { to { transform: rotate(360deg); } }

/* night-mode result photo */
.rv-nightphoto { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.rv-nightphoto .np-zoom { position: absolute; inset: 0; animation: npDev 1.2s ease-out; }
@keyframes npDev { from { filter: blur(10px) brightness(2.2) saturate(0); } to { filter: none; } }
.rv-nightphoto.img .np-fb { display: none; }
.np-fb { position: relative; width: min(78%, 300px); aspect-ratio: 2/3; overflow: hidden; border-radius: 4px; background:
  linear-gradient(90deg, #d8d4c8 0 30%, #0b0d0c 30% 70%, #cfcabd 70%);
  filter: contrast(1.05); animation: npDev 1.2s ease-out; }
.np-fb::before { content: ''; position: absolute; left: 30%; right: 30%; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, rgba(120,92,58,.85) 0 6px, rgba(98,74,46,.85) 6px 11px), radial-gradient(ellipse at 50% 50%, rgba(255,240,200,.12), transparent 70%); filter: brightness(.55) sepia(.3); }
.np-fb::after { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>"); mix-blend-mode: overlay; opacity: .8; }
.np-eye { position: absolute; z-index: 1; left: 31%; top: 34%; width: 7%; height: 2.4%; border-radius: 50%; background: radial-gradient(circle at 55% 50%, #111 0 28%, #c9c3b5 32% 60%, transparent 70%); filter: blur(.5px); opacity: .8; }
.np-card { position: absolute; z-index: 1; left: 36%; top: 52%; width: 28%; padding: 4% 3%; background: #e9e5da; color: #222; border-radius: 2px; transform: rotate(-2deg); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.6); filter: brightness(.8); }
.np-card small { display: block; font-size: 6px; line-height: 1.3; color: #444; }
.np-card b { display: block; margin-top: 3px; font-family: var(--hand); font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.np-tag { position: absolute; left: 14px; top: 12px; display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px; background: rgba(0,0,0,.55); color: #ffd60a; font-size: 12px; font-weight: 600; }
.np-tag svg { width: 13px; height: 13px; }

/* ---------------- close-ups ---------------- */
.rv-cu .cu-body { overflow: hidden; }
.cu-bowl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 55%, #3a332b 0%, #15120f 55%, #050404 100%); }
.cu-bowl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cu-bowl-fb { display: none; position: relative; width: 70%; aspect-ratio: 1.35; }
.cu-bowl.fallback .cu-bowl-fb { display: block; }
.bowl-dish { position: absolute; inset: 22% 4% 6%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #6e6a62 0 30%, #b7b2a7 33% 55%, #e2ddd2 58% 66%, #8c877d 70%); box-shadow: 0 18px 30px rgba(0,0,0,.7), inset 0 -8px 16px rgba(0,0,0,.35); }
.bowl-sticker { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%) rotate(-3deg); padding: 6px 12px; border-radius: 6px; background: #ffe3ea; color: #b23a5b; font-family: var(--hand); font-size: 22px; line-height: 1; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.4); white-space: nowrap; }
.bowl-sticker small { font-size: 15px; color: #6b4a52; }
.cu-peep { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.peep-lens { position: relative; width: min(82vw, 330px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 10px #0a0a0a, 0 0 0 12px #1a1a1a, 0 0 40px rgba(0,0,0,.9) inset; }
.peep-lens img { position: absolute; inset: -18%; width: 136%; height: 136%; object-fit: cover; filter: brightness(.2) contrast(1.35) saturate(.25) blur(.5px); transform: scale(1.12); }
.peep-vig { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, transparent 35%, rgba(0,0,0,.85) 72%, #000 100%); }
.cu-window { position: absolute; inset: 0; overflow: hidden; background: #000; }
.cu-window img { position: absolute; left: 50%; top: 40%; width: 225%; transform: translate(-54.5%, -40%); pointer-events: none; }
.win-base { filter: brightness(.5) contrast(1.1) saturate(.8); }
.win-refl { opacity: .07; transform: translate(-54.5%, -40%) scaleX(-1) !important; mix-blend-mode: screen; filter: brightness(1.4) blur(1.5px); }
.win-refl.dark-gap { opacity: .1; }
.win-rain { position: absolute; inset: -20% 0 0; pointer-events: none; background-image: repeating-linear-gradient(103deg, transparent 0 22px, rgba(200,215,235,.10) 22px 23px, transparent 23px 47px); animation: rvRain .55s linear infinite; mix-blend-mode: screen; }
.win-rain.r2 { background-image: repeating-linear-gradient(100deg, transparent 0 37px, rgba(220,230,255,.08) 37px 38px, transparent 38px 71px); animation-duration: .8s; }
@keyframes rvRain { from { transform: translateY(-60px); } to { transform: translateY(0); } }

/* ---------------- door-lock keypad ---------------- */
.dk { background: #0b0c0e; isolation: isolate; }
.dk .cu-top { position: relative; z-index: 2; }
.dk-sp { flex: 1; }
.dk-pitch { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; font-size: 12.5px; color: #cfd6e2; background: rgba(255,255,255,.08); margin-right: 6px; }
.dk-pitch-ic svg { width: 16px; height: 16px; display: block; }
.dk-pitch.on { background: #2f80ed; color: #fff; }
.dk-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 16px 0; gap: 10px; }
.dk-plate { position: relative; flex: none; height: min(60vh, 520px, calc(92vw / .71)); aspect-ratio: .71; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #73777c 0%, #55595e 45%, #3e4146 100%); box-shadow: 0 20px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06); }
.dk-inner { position: absolute; }
.dk-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dk-panel { position: absolute; border-radius: 6%/4%; background: linear-gradient(170deg, #1d1f23 0%, #0c0d0f 55%, #050506 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -2px 6px rgba(0,0,0,.7), 0 8px 18px rgba(0,0,0,.55); }
.dk-panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,.02) 35%, transparent 36%); }
.dk-plate.has-img .dk-panel { display: none; }
.dk-lcd { position: absolute; border-radius: 6px; background: rgba(3,6,10,.92); box-shadow: inset 0 0 0 1px rgba(90,170,255,.16), inset 0 2px 8px rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dk-slots { display: flex; gap: 5%; width: 88%; justify-content: center; }
.dk-slots i { flex: 1; max-width: 24px; height: 24px; border-bottom: 2px solid rgba(110,180,255,.28); font-style: normal; font: 600 17px/24px ui-monospace, Menlo, monospace; color: #8fd0ff; text-align: center; text-shadow: 0 0 8px rgba(90,170,255,.8); }
.dk-slots i.on { border-bottom-color: rgba(110,190,255,.85); }
.dk-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: .3px; color: #8fd0ff; opacity: 0; transition: opacity .15s; text-align: center; padding: 0 6px; background: rgba(3,6,10,.97); white-space: nowrap; }
.dk-lcd.err .dk-msg, .dk-lcd.ok .dk-msg, .dk-lcd.alarm .dk-msg { opacity: 1; }
.dk-lcd.err .dk-msg { color: #ff6b6b; text-shadow: 0 0 8px rgba(255,80,80,.7); }
.dk-lcd.ok .dk-msg { color: #7dffb0; text-shadow: 0 0 8px rgba(80,255,150,.6); }
.dk-lcd.alarm .dk-msg { color: #fff; background: #c1121f; animation: breathe .4s infinite; }
.dk-grid { position: absolute; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); }
.dk-key { position: relative; display: flex; align-items: center; justify-content: center; color: #a9dcff; background: transparent; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.dk-key::before { content: ''; position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 12%; box-shadow: inset 0 0 0 1.5px rgba(120,190,255,.5), 0 0 8px rgba(80,160,255,.25); transition: background .25s, box-shadow .25s; }
.dk-plate.has-img .dk-key::before { box-shadow: none; }
.dk-key b { position: relative; font: 500 clamp(17px, 5.2vw, 24px)/1 var(--font); text-shadow: 0 0 10px rgba(80,170,255,.9), 0 0 2px rgba(170,220,255,.9); }
.dk-key small { position: absolute; left: 0; right: 0; bottom: -1px; text-align: center; font-size: 9.5px; color: rgba(170,210,245,.65); letter-spacing: -.3px; white-space: nowrap; }
.dk-key.hit::before { animation: dkHit .45s ease-out; }
@keyframes dkHit { 0% { background: rgba(120,200,255,.45); box-shadow: inset 0 0 0 1.5px rgba(170,225,255,.95), 0 0 22px rgba(90,170,255,.8); } 100% { background: transparent; } }
.dk.locked .dk-key { opacity: .35; }
.dk.open .dk-key b { color: #7dffb0; text-shadow: 0 0 10px rgba(80,255,150,.8); }
.dk.shake .dk-plate { animation: wrongShake .45s; }
.dk-bars { flex: none; width: min(100%, 320px); height: 0; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,.04); transition: height .3s; }
.dk.pitch-on .dk-bars { height: 92px; }
.dk-bars-in { height: 100%; display: flex; align-items: flex-end; gap: 8px; padding: 22px 14px 18px; position: relative; }
.dk-bars-in::before { content: '낮음 ← 음높이 → 높음'; position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 9.5px; color: rgba(255,255,255,.35); }
.dk-bars-in i { position: relative; flex: 0 0 22px; border-radius: 4px 4px 2px 2px; background: linear-gradient(#7cc4ff, #2f80ed); transform-origin: bottom; transform: scaleY(0); transition: transform .25s cubic-bezier(.2,.9,.3,1); }
.dk-bars-in i.in { transform: scaleY(1); }
.dk-bars-in i span { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: 10px; color: #9fd8ff; }
.dk-foot { flex: none; padding: 8px 20px calc(var(--safe-bot) + 26px); min-height: 52px; }
.dk-status { text-align: center; font-size: 12.5px; color: rgba(255,255,255,.5); line-height: 1.5; word-break: keep-all; }
.dk-alarm { position: absolute; inset: 0; pointer-events: none; z-index: 5; background: #e00; opacity: 0; mix-blend-mode: screen; }
.dk-alarm.on { animation: dkAlarm .4s steps(1) infinite; }      /* 2.5 Hz (≤3 Hz) */
.dk-alarm.slow { animation: dkAlarm 1s steps(1) infinite; }    /* reduced flashing: 1 Hz */
@keyframes dkAlarm { 0% { opacity: .38; } 50% { opacity: 0; } }

/* ---------------- climax ---------------- */
#phone.power-save #screen { filter: brightness(.55); transition: filter 1.2s; }
.cx { position: absolute; inset: 0; isolation: isolate; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; background: #000; color: #eee; opacity: 0; transition: opacity .5s; overflow: hidden; }
.cx.in { opacity: 1; }
.cx-stage { position: absolute; inset: 0; }
.cx-cap { position: absolute; z-index: 4; left: 26px; right: 26px; bottom: calc(var(--safe-bot) + 196px); text-align: center; pointer-events: none; }
.cx-cap p { margin: 0; font-family: var(--serif); font-size: calc(16px * var(--ts, 1)); line-height: 1.7; color: #e8e4da; text-shadow: 0 1px 3px #000, 0 0 18px #000; opacity: 0; transform: translateY(6px); transition: opacity .6s, transform .6s; word-break: keep-all; }
.cx-cap p.in { opacity: 1; transform: none; }
.cx-mid { position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 26px 8%; pointer-events: none; text-align: center; }
.cx-mid p { margin: 0; font-family: var(--serif); font-size: calc(16px * var(--ts, 1)); line-height: 1.7; color: #e8e4da; text-shadow: 0 1px 3px #000, 0 0 18px #000; opacity: 0; transform: translateY(6px); transition: opacity .6s, transform .6s; word-break: keep-all; }
.cx-mid p.in { opacity: 1; transform: none; }
.cx-assist { position: absolute; z-index: 6; right: 14px; top: calc(var(--sb-h) + 12px); height: 34px; padding: 0 14px; border-radius: 17px; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,.18); opacity: 0; pointer-events: none; transform: translateY(-6px); transition: all .35s; }
.cx-assist.show { opacity: 1; pointer-events: auto; transform: none; }
.cx-scene { position: absolute; inset: 0; background: #000; overflow: hidden; }
.cx-scene.dark { background: #000; }
.cx-scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-scene.ajar { opacity: 0; transition: opacity .5s; }
.cx-scene.ajar.in { opacity: 1; }
.cx-scene.ajar img { filter: brightness(.55) contrast(1.15); transform: scale(1.04); transition: transform .5s cubic-bezier(.3,.9,.3,1), filter 1.2s; }
.cx-scene.ajar.stop img { transform: scale(1.0) translateX(-1%); }
.cx-scene.ajar.img .cx-ajar-fb { display: none; }
.cx-scene.guard img { filter: brightness(.32) contrast(1.15); }
.cx-scene.guard.lit img { filter: brightness(.85) contrast(1.1) sepia(.1); }
.cx-scene.swing { transition: opacity .7s, filter .7s; opacity: 0; filter: brightness(0); }
.cx-ajar-fb { position: absolute; inset: 0; background: linear-gradient(90deg, #2c2d30 0 46%, #000 46% 53%, #3a3b3f 53% 100%); filter: brightness(.6); }
.cx-scene.guard.lit .cx-ajar-fb { filter: brightness(1); }
.cx-ajar-fb .slit { position: absolute; left: 46%; width: 7%; top: 0; bottom: 0; background: linear-gradient(#000, #050505 50%, #000); box-shadow: inset 0 0 20px #000; }
.cx-ajar-fb .ubar { position: absolute; left: 38%; top: 26%; width: 22%; height: 3.2%; border-radius: 30px; background: linear-gradient(#d8dbe0, #8d9299 60%, #5f646b); box-shadow: 0 3px 6px rgba(0,0,0,.7); transform: translateX(calc(var(--gp, 0) * 60%)); }
.cx-scene.js2dread img { opacity: 0; transition: opacity 1.4s ease-in; filter: brightness(.55) contrast(1.05); }
.cx-scene.js2dread.in img { opacity: 1; }

.cx-black { position: absolute; inset: 0; z-index: 88; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s; }
.cx-black.on { opacity: 1; pointer-events: auto; }

.cx-prompt { position: absolute; z-index: 5; left: 50%; top: calc(var(--sb-h) + 100px); transform: translate(-50%, -6px); padding: 9px 16px; border-radius: 20px; background: rgba(0,0,0,.6); color: #ffd60a; font-size: 14px; font-weight: 600; opacity: 0; transition: all .4s; white-space: nowrap; border: 1px solid rgba(255,214,10,.3); }
.cx-prompt.in { opacity: 1; transform: translate(-50%, 0); }
.cx-bigbtn { position: absolute; z-index: 5; left: 24px; right: 24px; bottom: calc(var(--safe-bot) + 210px); height: 56px; border-radius: 16px; background: rgba(255,214,10,.92); color: #111; font-size: 17px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .4s; }
.cx-bigbtn.show { opacity: 1; pointer-events: auto; transform: none; }

.cx-hide { position: absolute; z-index: 3; left: 0; right: 0; top: 50%; transform: translateY(-46%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 28px; text-align: center; opacity: 0; transition: opacity .5s; pointer-events: none; }
.cx-hide.in { opacity: 1; pointer-events: auto; }
.cx-hide-t { font-size: calc(19px * var(--ts, 1)); font-weight: 700; color: #fff; letter-spacing: -.3px; }
.cx-hide-s { font-size: 12.5px; color: rgba(255,255,255,.55); line-height: 1.5; word-break: keep-all; }
.cx-hold { position: relative; margin-top: 18px; width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #ffd60a; background: radial-gradient(circle, rgba(255,214,10,.16) 0%, rgba(255,214,10,.06) 60%, transparent 70%); border: 1.5px solid rgba(255,214,10,.45); touch-action: none; transition: transform .3s, width .4s, height .4s; }
.cx-hold i { position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid rgba(255,214,10,.4); animation: cxRipple 2.2s ease-out infinite; pointer-events: none; }
.cx-hold i:nth-child(2) { animation-delay: 1.1s; }
@keyframes cxRipple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.cx-hold-ic svg { width: 46px; height: 46px; display: block; }
.cx-hold:active { transform: scale(.94); }
.cx-hide.big .cx-hold { width: 150px; height: 150px; background: radial-gradient(circle, rgba(255,214,10,.26) 0%, rgba(255,214,10,.08) 60%, transparent 70%); }
.cx-hide.big .cx-hide-t { color: #ffd60a; }

/* mom call (KakaoTalk voice call style) */
.cx-callui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--sb-h) + 70px) 0 calc(var(--safe-bot) + 168px); color: #fff; opacity: 0; transition: opacity .3s; }
.cx-callui.in { opacity: 1; }
.cx-callui.jitter { animation: cxJitter .12s steps(2) infinite; }
@keyframes cxJitter { 0% { transform: translate(1px, 0); } 50% { transform: translate(-1px, 1px); } }
.cu-blur { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, #4a4038 0%, #241f1b 45%, #0e0c0b 100%); z-index: -1; }
.cc-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cc-av { width: 96px; height: 96px; border-radius: 38px; background: #b9a58c center/cover; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.cc-name { font-size: 27px; font-weight: 600; letter-spacing: -.5px; }
.cc-name small { font-size: 15px; color: rgba(255,255,255,.6); font-weight: 500; }
.cc-sub { font-size: 14px; color: rgba(255,255,255,.7); }
.cc-btns { display: flex; justify-content: space-around; padding: 0 34px; }
.cc-b { display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: 13px; color: rgba(255,255,255,.85); }
.cc-b button { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.cc-b button svg { width: 32px; height: 32px; }
.cc-dec { background: #ff3b30; }
.cc-acc { background: #34c759; animation: ringPulse 1.3s infinite; }
.cx-callui.wide .cc-btns { flex-direction: column; gap: 14px; padding: 0 24px; }
.cx-callui.wide .cc-b { flex-direction: row; justify-content: center; }
.cx-callui.wide .cc-b:not(.acc) button { width: 100%; height: 64px; border-radius: 18px; }
.cx-callui.wide .cc-b:not(.acc) { display: block; position: relative; }
.cx-callui.wide .cc-b:not(.acc) span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; pointer-events: none; font-size: 18px; font-weight: 700; color: #fff; padding-left: 40px; }
.cx-callui.wide .cc-b:not(.acc) svg { margin-right: 70px; }
.cx-callui.wide .cc-b.acc { opacity: .55; transform: scale(.8); }
.cx-callui.ended { opacity: .6; transition: opacity .8s; }

/* door guard drag */
.cx-guard { position: absolute; z-index: 3; left: 22px; right: 22px; bottom: calc(var(--safe-bot) + 150px); display: flex; flex-direction: column; gap: 12px; transition: opacity .6s; }
.cx-guard.out { opacity: 0; }
.cg-label { font-size: 12.5px; color: rgba(255,255,255,.6); letter-spacing: .5px; text-align: center; }
.cg-track { position: relative; height: 66px; border-radius: 33px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
.cg-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255,214,10,.05), rgba(255,214,10,.22)); }
.cg-end { position: absolute; right: 18px; top: 50%; width: 10px; height: 30px; margin-top: -15px; border-radius: 3px; border: 2px dashed rgba(255,255,255,.3); }
.cg-knob { position: absolute; left: 4px; top: 4px; width: 92px; height: 56px; border-radius: 28px; display: flex; align-items: center; justify-content: center; color: #c7ccd3; background: linear-gradient(#3a3d42, #1d1f22); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px rgba(0,0,0,.6); touch-action: none; cursor: grab; }
.cg-knob svg { width: 66px; height: 34px; }
.cg-knob.grab { cursor: grabbing; color: #fff; }
.cg-knob.freeze { animation: wrongShake .45s; color: #ff6b6b; }
.cg-knob.done { color: #7dffb0; }
.cg-hint { text-align: center; font-size: 13px; color: #ffd60a; opacity: 0; transition: opacity .5s; }
.cg-hint.show { opacity: .85; }
.cg-holdbtn { align-self: center; height: 44px; padding: 0 20px; border-radius: 22px; background: rgba(255,214,10,.14); border: 1px solid rgba(255,214,10,.45); color: #ffd60a; font-size: 13.5px; font-weight: 600; display: none; touch-action: none; }
.cg-holdbtn.show { display: block; }

/* swipe handle */
.cx-swipe { position: absolute; z-index: 6; left: 20px; right: 20px; bottom: calc(var(--safe-bot) + 200px); display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(12px); transition: all .45s; }
.cx-swipe.in { opacity: 1; transform: none; }
.cs-t { text-align: center; font-family: var(--serif); font-size: 15px; color: #fff; text-shadow: 0 1px 4px #000; }
.cs-track { position: relative; height: 64px; border-radius: 32px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; }
.cs-label { font-size: 15px; font-weight: 600; letter-spacing: .3px; color: transparent; background: linear-gradient(90deg, rgba(255,255,255,.35) 0%, #fff 50%, rgba(255,255,255,.35) 100%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; animation: csShine 2.2s linear infinite; padding-left: 40px; }
@keyframes csShine { from { background-position: 200% 0; } to { background-position: 0 0; } }
.cs-knob { position: absolute; left: 4px; top: 4px; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #111; display: flex; align-items: center; justify-content: center; touch-action: none; box-shadow: 0 4px 12px rgba(0,0,0,.4); cursor: grab; }
.cs-knob svg { width: 26px; height: 26px; }
.cs-knob.nudge { animation: csNudge .6s; }
@keyframes csNudge { 40% { transform: translateX(26px); } }

.cx-white { position: absolute; inset: 0; z-index: 95; background: #fff; opacity: 0; transition: opacity 1s; display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.cx-white.in { opacity: 1; }
.cx-white.out { opacity: 0; pointer-events: none; transition: opacity 1.2s; }
.cx-win { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: 2px; color: #111; opacity: 0; transform: translateY(8px); transition: opacity 1.4s, transform 1.4s; }
.cx-white.text .cx-win { opacity: 1; transform: none; }

/* fallback 비상벨 */
.cx-bell { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #f2f3f5; color: #111; opacity: 0; transition: opacity .4s; padding: 0 30px; text-align: center; }
.cx-bell.in { opacity: 1; }
.cb-head { position: absolute; top: calc(var(--sb-h) + 14px); left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #666; }
.cb-head b { font-size: 18px; color: #0d7c66; }
.cb-btn { position: relative; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #ff5a4f, #d4161c 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 14px 40px rgba(212,22,28,.45); animation: cbPulse 1.2s ease-in-out infinite; touch-action: none; }
.cb-btn.hold { animation: none; transform: scale(.96); }
.cb-btn b { font-size: 22px; letter-spacing: 1px; }
.cb-ic svg { width: 46px; height: 46px; }
.cb-ring { position: absolute; inset: -12px; }
.cb-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cb-ring circle { fill: none; stroke-width: 5; }
.cb-ring .bg { stroke: rgba(212,22,28,.15); }
.cb-ring .fg { stroke: #d4161c; stroke-linecap: round; }
@keyframes cbPulse { 50% { box-shadow: 0 14px 40px rgba(212,22,28,.45), 0 0 0 16px rgba(255,60,50,.12); } }
.cb-t { font-size: 17px; font-weight: 700; }
.cb-s { font-size: 13px; color: #777; }
.cx-bell.done .cb-btn { background: #34c759; box-shadow: none; animation: none; }

/* subtitles for directional / whisper / handwriting lines (fx-layer) */
.fx-subs .sub.whisper { font-style: italic; letter-spacing: 1px; color: #ddd; }
.fx-subs .sub.hand { font-family: var(--hand); font-size: 24px; color: #f3eee2; }

/* ---------------- H6 voice call ---------------- */
.vt { position: absolute; inset: 0; isolation: isolate; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--sb-h) + 8px) 0 calc(var(--safe-bot) + 46px); opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .35s cubic-bezier(.2,.9,.3,1); }
.vt.in { opacity: 1; transform: none; }
.vt.out { opacity: 0; transform: translateY(20px); }
.vt-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 18%, #55595f 0%, #2b2d31 45%, #121315 100%); }
.vt-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; }
.vt-min { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; border-radius: 50%; }
.vt-min svg { width: 26px; height: 26px; }
.vt-kind { font-size: 13px; color: rgba(255,255,255,.65); margin-right: 12px; }
.vt-mid { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: -40px; }
.vt-av { width: 104px; height: 104px; border-radius: 40px; background: #9aa3ad; color: #dfe4ea; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.vt-av svg { width: 82%; height: 82%; }
.vt-name { font-size: 27px; font-weight: 600; letter-spacing: -.5px; }
.vt-status { font-size: 14px; color: rgba(255,255,255,.7); min-height: 18px; }
.vt-ops { display: flex; justify-content: center; gap: 30px; }
.vt-op { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #fff; font-size: 12px; }
.vt-op span { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.vt-op span svg { width: 26px; height: 26px; }
.vt-op.on span { background: #fff; color: #111; }
.vt-op small { color: rgba(255,255,255,.75); font-size: 12px; }
.vt-endrow { display: flex; justify-content: center; }
.vt-end { width: 70px; height: 70px; border-radius: 50%; background: #ff3b30; color: #fff; display: flex; align-items: center; justify-content: center; }
.vt-end svg { width: 32px; height: 32px; }
.vt-bar { position: absolute; z-index: 85; left: 12px; top: calc(var(--safe-top) + 3px); height: calc(var(--sb-h) - var(--safe-top) - 6px); min-height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 11px 0 9px; border-radius: 13px; background: #30d158; color: #04230e; font-size: 12.5px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transform: scale(.85); transition: opacity .3s, transform .35s cubic-bezier(.2,.9,.3,1); white-space: nowrap; }
.vt-bar.show { opacity: 1; pointer-events: auto; transform: none; }
.vt-bar i { width: 7px; height: 7px; border-radius: 50%; background: #04230e; animation: breathe 1s infinite; }
.vb-t { font-weight: 700; }
.vb-s { font-weight: 500; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  .rv-turn.turn-r, .rv-turn.turn-l, .cx-hold i, .cx-callui.jitter, .cs-label, .rv-led, .cb-btn { animation: none !important; }
}

/* ---------------- simulated front camera (no getUserMedia — ARCH override) ---------------- */
.selfie-fake { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse 120% 70% at 50% 100%, #1d1a17 0%, #0b0a09 55%, #030303 100%); }
.sf-glow { position: absolute; left: 10%; right: 10%; bottom: -10%; height: 55%; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, rgba(150,170,210,.16), transparent 70%); filter: blur(10px); animation: sfFlicker 5s ease-in-out infinite; }
.sf-shadow { position: absolute; left: 50%; top: 30%; width: 46%; aspect-ratio: .78; transform: translateX(-50%); border-radius: 48% 48% 42% 42%; background: radial-gradient(ellipse at 50% 70%, rgba(120,130,150,.12), rgba(0,0,0,0) 70%); filter: blur(14px); }
.sf-shadow::after { content: ''; position: absolute; left: -40%; right: -40%; top: 95%; height: 90%; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 0%, rgba(110,120,140,.1), transparent 70%); }
@keyframes sfFlicker { 50% { opacity: .75; } }
