:root {
  --accent: #ffc83d; /* native: colors.xml camera_color (session.colors.camera_color) */
  --red: #ff3b4e;
  --top: 0px;
  --bottom: 0px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; overflow: hidden; overscroll-behavior: none; touch-action: none;
  font: 500 14px/1.2 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; user-select: none; -webkit-user-select: none; }
@font-face { font-family: 'App'; src: url(fonts/semibold.ttf); font-weight: 600; font-display: swap; }
body { font-family: 'App', system-ui, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#app, .cam { position: fixed; inset: 0; }
.cam { overflow: hidden; background: #000; }

.preview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .18s; }
.cam.ready .preview { opacity: 1; }
.touch { position: absolute; inset: 0; }
.closed { position: absolute; inset: 0; background: #000; }

/* top */
.top { position: absolute; left: 0; right: 0; top: calc(var(--top) + 6px); height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; transition: opacity .2s; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; filter: drop-shadow(var(--shadow)); }
.hide { opacity: 0; pointer-events: none; }
.timer { position: absolute; top: calc(var(--top) + 16px); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.45); padding: 6px 12px; border-radius: 16px; font-size: 13px; font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.timer i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* tools */
.tools { position: absolute; right: 6px; top: calc(var(--top) + 64px); display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; }
.tool .ti { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.22); filter: drop-shadow(var(--shadow)); }
.tool.on .ti { color: var(--accent); }
.tool small { font-size: 11px; text-shadow: var(--shadow); white-space: nowrap; }
.tool .x { position: absolute; right: -2px; top: -2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #000; font-size: 13px; line-height: 15px; }
.tool .badge { position: absolute; right: -2px; bottom: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #000; font-size: 10px; line-height: 16px; }

/* bottom */
.bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--bottom) + 8px); display: flex; flex-direction: column; align-items: stretch; }
.cats { display: flex; justify-content: center; gap: 18px; margin-bottom: 8px; }
.cats button { font-size: 13px; opacity: .7; text-shadow: var(--shadow); padding: 4px 2px; }
.cats button.on { opacity: 1; color: var(--accent); }
.row { position: relative; height: 96px; display: flex; align-items: center; }
.carousel { position: absolute; inset: 0; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.carousel::-webkit-scrollbar { display: none; }
.fx { flex: none; scroll-snap-align: center; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.18); display: grid; place-items: center; position: relative; transition: transform .15s; }
.fx img { width: 70%; height: 70%; object-fit: contain; pointer-events: none; }
.fx.full img { width: 100%; height: 100%; object-fit: cover; }
.fx.loading::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
.fx .new { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.capture { position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%; touch-action: none; display: grid; place-items: center; transition: transform .2s; }
.capture svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.capture .ring { fill: none; stroke: #fff; stroke-width: 6; filter: drop-shadow(0 0 2px rgba(0,0,0,.35)); }
.capture .prog { fill: none; stroke: var(--red); stroke-width: 6; stroke-dasharray: 283; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.capture.rec { transform: scale(1.3); }
.capture.busy { opacity: .5; }
.capture.hf .ring, .capture.boom .ring { fill: rgba(255,255,255,.12); }
.hfdot { width: 56px; height: 56px; border-radius: 50%; background: var(--red); transition: all .2s; }
.hfdot.stop { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
.boomicon { color: #fff; }

.base { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; height: 54px; margin-top: 4px; padding: 0 8px; transition: opacity .2s; }
.gallery { border-radius: 10px; }
.types { display: flex; justify-content: center; gap: 20px; overflow-x: auto; scrollbar-width: none; }
.types button { font-size: 14px; font-weight: 600; letter-spacing: .3px; opacity: .65; text-transform: uppercase; text-shadow: var(--shadow); padding: 6px 0; }
.types button.on { opacity: 1; color: var(--accent); }

/* reels parts */
.parts { display: flex; align-items: center; gap: 10px; padding: 6px 12px 0; height: 76px; }
.parts .list { flex: 1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.part { position: relative; flex: none; width: 42px; height: 64px; border-radius: 8px; overflow: hidden; background: #222; }
.part img, .part span { width: 100%; height: 100%; object-fit: cover; display: block; }
.part em { position: absolute; left: 3px; bottom: 2px; font-size: 10px; font-style: normal; text-shadow: var(--shadow); }
.part button { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.next { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; background: #fff; color: #000; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* beauty */
.beauty { background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0)); padding: 10px 0 4px; }
.btabs { display: flex; gap: 18px; justify-content: center; align-items: center; margin-bottom: 8px; }
.btabs button { font-size: 13px; opacity: .7; padding: 4px 0; }
.btabs button.on { opacity: 1; color: var(--accent); }
.btabs .reset { opacity: .8; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 14px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 12px; border-radius: 16px; background: rgba(255,255,255,.14); font-size: 12px; position: relative; }
.chip.on { background: #fff; color: #000; }
.chip.set::after { content: ''; position: absolute; top: 3px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.looks { gap: 12px; }
.look { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; }
.look img, .look > svg { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.14); padding: 0; border: 2px solid transparent; }
.look > svg { padding: 12px; }
.look.on img, .look.on > svg { border-color: var(--accent); }
.look span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.look.loading img { opacity: .5; }
.slider { display: flex; align-items: center; gap: 10px; padding: 2px 18px 6px; }
.slider input { flex: 1; accent-color: #fff; height: 28px; }
.slider span { width: 30px; text-align: end; font-size: 12px; font-variant-numeric: tabular-nums; }
.swatches { display: flex; gap: 10px; padding: 0 16px 6px; overflow-x: auto; scrollbar-width: none; }
.sw { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); display: grid; place-items: center; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.sw.none { background: rgba(255,255,255,.12); }

/* overlays */
.collage { position: absolute; inset: 0; pointer-events: none; }
.collage .cell { position: absolute; border: 1.5px solid rgba(255,255,255,.75); overflow: hidden; background: rgba(0,0,0,.55); }
.collage .cell.current { background: transparent; border-color: var(--accent); }
.collage .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-guide { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; }
.post-guide div { width: 100%; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); }
.focus { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 1.5px solid #fff; border-radius: 50%; pointer-events: none; animation: focus 1.3s forwards; }
@keyframes focus { 0% { transform: scale(1.4); opacity: 1; } 15% { transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
.splash { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,.5); animation: blink .1s steps(1) infinite; pointer-events: none; }
.white { position: absolute; inset: 0; background: #fff; z-index: 20; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); z-index: 15; }
.busy i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
.toast { position: absolute; left: 24px; right: 24px; top: 42%; text-align: center; background: rgba(0,0,0,.7); padding: 12px 16px; border-radius: 14px; font-size: 14px; z-index: 16; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
[dir='rtl'] .tools { right: auto; left: 6px; }
