/* ============================================================
   topdevphone — Camera app styles
   Graphite gradient identity (#3a3a3f → #141416).

   The viewfinder is the GAME: while the camera app is the visible
   app, `body.camera-open` makes the phone shell transparent so the
   world shows through, and only the chrome below is drawn on top.
   Every rule that punches a hole in the shell is scoped to
   body.camera-open so nothing else in the phone is affected.
   ============================================================ */

/* ---------- see-through shell (scoped to the camera) ---------- */
body.camera-open #phone-screen { background: transparent; }
body.camera-open #phone-screen > .wallpaper { opacity: 0; }
body.camera-open #screen-home { visibility: hidden; }
body.camera-open #app-container { background: transparent; }
body.camera-open #app-container.active { animation: none; }
/* run the viewfinder full-bleed, behind the status bar */
body.camera-open .app-view { top: 0; }

/* the client hides the whole overlay for one frame before a
   screenshot so the phone is not baked into the capture */
#phone-root.cam-shell-hidden { opacity: 0; transition: opacity 0.06s linear; }

/* ---------- viewfinder chrome ---------- */
.cam-root {
  position: absolute; inset: 0; overflow: hidden;
  color: #fff; user-select: none;
}

.cam-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}

/* rule-of-thirds grid */
.cam-grid { position: absolute; inset: 0; pointer-events: none; }
.cam-grid span { position: absolute; background: rgba(255, 255, 255, 0.22); }
.cam-grid span:nth-child(1) { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.cam-grid span:nth-child(2) { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.cam-grid span:nth-child(3) { top: 33.33%; left: 0; right: 0; height: 1px; }
.cam-grid span:nth-child(4) { top: 66.66%; left: 0; right: 0; height: 1px; }

/* focus brackets */
.cam-brackets { position: absolute; inset: 96px 34px 190px; pointer-events: none; }
.cam-brackets i {
  position: absolute; width: 22px; height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 3px;
}
.cam-brackets i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.cam-brackets i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.cam-brackets i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.cam-brackets i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* top toggle chips */
.cam-top {
  position: absolute; top: 46px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px; padding: 0 12px;
}
.cam-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 18px;
  background: rgba(12, 12, 16, 0.5); backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.2px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.cam-chip .ic { width: 14px; height: 14px; }
.cam-chip:active { transform: scale(0.94); }
.cam-chip.on { background: rgba(255, 214, 92, 0.92); color: #241703; }

/* browser-demo zoom pill — it scales the stand-in scene. Hidden in
   NUI: real in-game zoom needs a scripted game camera, and this
   module will not pretend to do something it does not do. */
.cam-zoom {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 178px;
  display: flex; gap: 6px; padding: 5px; border-radius: 20px;
  background: rgba(12, 12, 16, 0.5); backdrop-filter: blur(10px);
}
.cam-zoom button {
  min-width: 34px; height: 26px; border-radius: 14px;
  font-size: 11.5px; font-weight: 800; color: rgba(255, 255, 255, 0.75);
}
.cam-zoom button.on { background: rgba(255, 255, 255, 0.9); color: #141416; }

/* bottom controls */
.cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 18px 26px;
  background: linear-gradient(180deg, transparent, rgba(8, 8, 10, 0.72) 42%);
}
.cam-modes { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.cam-modes button {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.55); padding: 4px 2px; position: relative;
}
.cam-modes button.on { color: #ffd65c; }
.cam-modes button.on::after {
  content: ''; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #ffd65c;
}

.cam-row { display: flex; align-items: center; justify-content: space-between; }

.cam-thumb {
  width: 46px; height: 46px; border-radius: 11px; overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.cam-thumb:active { transform: scale(0.92); }
.cam-thumb .cam-media { width: 100%; height: 100%; display: block; object-fit: cover; }
.cam-thumb-empty { display: flex; color: rgba(255, 255, 255, 0.6); font-size: 19px; }
.cam-media.cam-ph { display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.12); }

.cam-shutter {
  width: 74px; height: 74px; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.cam-shutter .cs-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.92);
}
.cam-shutter .cs-dot {
  width: 58px; height: 58px; border-radius: 50%; background: #fff;
  transition: transform 0.12s, background 0.12s;
}
.cam-shutter:active .cs-dot { transform: scale(0.86); background: #d9d9de; }
.cam-shutter.firing .cs-dot { transform: scale(0.8); background: #cfcfd6; }

.cam-side {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff; transition: transform 0.12s;
}
.cam-side:active { transform: scale(0.9); }

.cam-hint {
  text-align: center; margin-top: 12px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.5);
}

/* shutter flash */
.cam-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
}
.cam-flash.fire { animation: camFlash 0.34s ease-out; }
.cam-flash.strong.fire { animation: camFlashStrong 0.44s ease-out; }
@keyframes camFlash { 0% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes camFlashStrong { 0% { opacity: 0.95; } 35% { opacity: 0.55; } 100% { opacity: 0; } }

/* self-timer countdown */
.cam-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 96px; font-weight: 300; color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.55); pointer-events: none;
}
.cam-count.pop { animation: camCount 1s ease-out; }
@keyframes camCount { 0% { transform: scale(1.35); opacity: 0.2; } 30% { transform: scale(1); opacity: 1; } 100% { opacity: 0.65; } }

/* ============================================================
   Browser-demo scene — stands in for the game world when the UI
   runs outside FiveM. 100% CSS: no images, no network requests.
   ============================================================ */
.cam-scene {
  position: absolute; inset: 0; overflow: hidden;
  transform-origin: 50% 55%; transition: transform 0.35s cubic-bezier(0.32, 0.72, 0.35, 1);
}
.cam-scene .cs-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #1b3a86 0%, #4b7bd1 32%, #ffb37a 74%, #ff7d6b 100%);
  animation: csDay 26s ease-in-out infinite alternate;
}
@keyframes csDay {
  0% { filter: hue-rotate(0deg) saturate(1); }
  100% { filter: hue-rotate(-18deg) saturate(1.25); }
}
.cam-scene .cs-sun {
  position: absolute; left: 62%; top: 46%; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe6 0%, #ffd47a 45%, rgba(255, 180, 90, 0) 72%);
  animation: csSun 22s ease-in-out infinite alternate;
}
@keyframes csSun { 0% { transform: translateY(-26px) scale(0.94); } 100% { transform: translateY(16px) scale(1.06); } }

.cam-scene .cs-cloud {
  position: absolute; height: 46px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 72%);
  filter: blur(1px);
}
.cam-scene .cs-cloud.c1 { top: 16%; width: 190px; animation: csDrift 34s linear infinite; }
.cam-scene .cs-cloud.c2 { top: 27%; width: 130px; opacity: 0.75; animation: csDrift 48s linear infinite -12s; }
.cam-scene .cs-cloud.c3 { top: 9%; width: 240px; opacity: 0.5; animation: csDrift 62s linear infinite -30s; }
@keyframes csDrift { from { transform: translateX(-260px); } to { transform: translateX(420px); } }

.cam-scene .cs-far {
  position: absolute; left: -10%; right: -10%; bottom: 30%; height: 30%;
  background: linear-gradient(180deg, #6b4a86, #40305e);
  clip-path: polygon(0 62%, 12% 30%, 24% 54%, 38% 18%, 52% 48%, 66% 22%, 80% 52%, 92% 34%, 100% 58%, 100% 100%, 0 100%);
  opacity: 0.85;
}
.cam-scene .cs-near {
  position: absolute; left: -6%; right: -6%; bottom: 26%; height: 22%;
  background: linear-gradient(180deg, #3a2a52, #201634);
  clip-path: polygon(0 70%, 16% 40%, 30% 66%, 46% 34%, 62% 62%, 78% 40%, 92% 68%, 100% 52%, 100% 100%, 0 100%);
}
.cam-scene .cs-road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  background: linear-gradient(180deg, #2a2733 0%, #17151d 100%);
}
.cam-scene .cs-dash {
  position: absolute; left: 50%; bottom: 0; width: 10px; height: 28%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, rgba(255, 226, 140, 0.9) 0 22px, transparent 22px 52px);
  animation: csDash 1.5s linear infinite;
  mask-image: linear-gradient(180deg, transparent, #000 40%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%);
}
@keyframes csDash { to { background-position-y: 52px; } }
.cam-scene .cs-haze {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 40% at 62% 52%, rgba(255, 196, 128, 0.35), transparent 70%),
    linear-gradient(180deg, transparent 60%, rgba(20, 12, 30, 0.35) 100%);
}
