* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; overscroll-behavior: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }
#app { position: fixed; inset: 0; }
#video, #view, #ovl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#video { background: #000; }
#video.mirror { transform: scaleX(-1); }
#view { background: transparent; }

#top { position: absolute; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(#000a, #0000); z-index: 5; }
.pill { display: flex; gap: 6px; align-items: center; background: #0007; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 18px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.pill .ic { font-size: 15px; }
#btnTimer.on { color: #ffd60a; }
#recTime { background: #ff3b30; border-radius: 6px; padding: 3px 9px; font-variant-numeric: tabular-nums; font-weight: 600; }

#faceTags { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ftag { position: absolute; transform: translate(-50%, -100%); background: #0008; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 12px; padding: 3px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; color: #ffd60a; }
.ftag.unk { color: #fff; opacity: 0.75; }

#bubble { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 250px); max-width: 86%; background: #000b; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.3; z-index: 6; text-align: center; }
#bubble .you { opacity: 0.6; font-size: 13px; display: block; margin-bottom: 3px; }

#zoom { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 200px); display: flex; gap: 8px; background: #0005; border-radius: 22px; padding: 4px; z-index: 5; }
#zoom button { width: 36px; height: 36px; border-radius: 50%; background: #0008; font-size: 12px; font-weight: 700; }
#zoom button.on { color: #ffd60a; font-size: 13px; }

#filters { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 250px); display: flex; gap: 10px; overflow-x: auto; padding: 0 16px; z-index: 5; scrollbar-width: none; }
#filters button { flex: 0 0 auto; padding: 8px 14px; border-radius: 16px; background: #000a; font-size: 13px; font-weight: 600; }
#filters button.on { color: #000; background: #ffd60a; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 0 calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(#0000, #000c 30%); z-index: 5; }
#modes { display: flex; justify-content: center; gap: 22px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; padding: 6px 0 12px; }
#modes button { opacity: 0.85; }
#modes button.on { color: #ffd60a; opacity: 1; }
#controls { display: flex; justify-content: space-between; align-items: center; padding: 0 34px; }
#thumb { width: 46px; height: 46px; border-radius: 8px; background: #222 center/cover; border: 1.5px solid #fff3; }
#shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
#shutter span { width: 62px; height: 62px; border-radius: 50%; background: #fff; transition: all 0.2s; }
#shutter:active span { transform: scale(0.9); }
#shutter.video span { background: #ff3b30; }
#shutter.recording span { width: 30px; height: 30px; border-radius: 7px; }
#flip { width: 46px; height: 46px; border-radius: 50%; background: #fff2; font-size: 24px; }

#agentBar { display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 14px; }
#mic { display: flex; align-items: center; gap: 9px; background: #fff; color: #000; border-radius: 24px; padding: 11px 22px; font-weight: 700; font-size: 15px; min-width: 170px; justify-content: center; }
#mic .dot { width: 10px; height: 10px; border-radius: 50%; background: #34c759; }
#mic.listening { background: #ff3b30; color: #fff; }
#mic.listening .dot { background: #fff; animation: pulse 0.9s infinite; }
#mic.thinking { background: #5e5ce6; color: #fff; }
#mic.thinking .dot { background: #fff; animation: pulse 0.5s infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: 0.5; } }
#kbd, #loop { width: 42px; height: 42px; border-radius: 50%; background: #fff2; font-size: 18px; }
#loop.on { background: #34c759; color: #000; }

#typeBox { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); display: flex; gap: 8px; z-index: 9; background: #1c1c1e; padding: 8px; border-radius: 16px; }
#typeBox input { flex: 1; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 0; background: #2c2c2e; color: #fff; }
#typeBox button { background: #ffd60a; color: #000; border-radius: 10px; padding: 0 14px; font-weight: 700; }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 8; transition: opacity 0.25s; }
#flash.on { opacity: 0.9; transition: none; }
#countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 140px; font-weight: 200; text-shadow: 0 4px 30px #000a; pointer-events: none; z-index: 7; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow-y: auto; background: #1c1c1ef2; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 18px 18px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px); z-index: 10; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #fff4; margin: 2px auto 10px; }
.sheetHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheetHead small { display: block; opacity: 0.6; font-size: 12px; margin-top: 2px; }
.x { width: 30px; height: 30px; border-radius: 50%; background: #fff2; }
.row { display: flex; gap: 8px; margin: 10px 0; }
.row input { flex: 1; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 0; background: #2c2c2e; color: #fff; }
.row button, .sheet .primary { padding: 10px 14px; border-radius: 10px; background: #3a3a3c; font-weight: 600; }
.primary { background: #ffd60a !important; color: #000 !important; }
.danger { color: #ff453a !important; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; margin: 12px 0 6px; }
.sl { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }
.sl input { width: 100%; accent-color: #ffd60a; }
.sl output { font-size: 12px; opacity: 0.6; text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { padding: 7px 11px; border-radius: 14px; background: #3a3a3c; font-size: 13px; }
.chips button.on { background: #ffd60a; color: #000; font-weight: 600; }
.chips .sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #fff3; }
.chips .sw.on { border-color: #ffd60a; box-shadow: 0 0 0 2px #ffd60a; }
.hint { font-size: 13px; opacity: 0.65; margin: 4px 0 10px; }
.person { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #fff1; }
.person small { display: block; opacity: 0.55; font-size: 12px; }

#viewer { position: absolute; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; }
.vhead { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; }
.vhead button { padding: 8px 12px; border-radius: 10px; background: #fff2; }
#vmedia { flex: 1; display: grid; place-items: center; overflow: hidden; }
#vmedia img, #vmedia video { max-width: 100%; max-height: 100%; }
.vnav { display: flex; justify-content: space-between; padding: 10px 20px calc(env(safe-area-inset-bottom) + 12px); }
.vnav button { padding: 10px 18px; border-radius: 10px; background: #fff2; font-size: 18px; }

#splash { position: absolute; inset: 0; z-index: 30; background: radial-gradient(circle at 50% 30%, #2a2a2e, #000 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
#splash .logo { font-size: 64px; color: #ffd60a; }
#splash h1 { margin: 6px 0; font-size: 32px; }
#splash p { opacity: 0.8; max-width: 320px; line-height: 1.4; }
#splash ul { list-style: none; padding: 0; margin: 10px 0 26px; opacity: 0.9; }
#splash li { background: #ffffff14; border-radius: 12px; padding: 8px 14px; margin: 6px 0; font-size: 15px; }
.big { font-size: 18px !important; padding: 15px 34px !important; border-radius: 30px !important; font-weight: 700; }
#splash small { margin-top: 16px; opacity: 0.55; font-size: 12px; max-width: 300px; }
