html {
    background: #000 !important;
}

html,
body.live-cam-body {
    overflow-y: auto !important;
    height: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body.camera-active {
    overflow: hidden !important;
    height: 100dvh !important;
    overscroll-behavior: none !important;
}

#camera-modal {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.live-cam-body {
    background: radial-gradient(circle at 50% 30%, #171511 0%, #070707 100%);
    color: #ffffff;
    min-height: 100dvh;
    padding-bottom: 80px;
    position: relative;
    
    /* Transition styles for iOS slide down dismiss */
    transition: transform 0.55s cubic-bezier(0.32, 0.94, 0.6, 1), opacity 0.55s ease;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.live-cam-body.slide-down-out {
    transform: translateY(100dvh) scale(0.96);
    opacity: 0;
}

.header-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(7, 7, 7, 0.8);
}

.header-bar .back-btn {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    transition: color 0.3s;
    z-index: 102;
}

.header-bar .back-btn:hover {
    color: var(--gold);
}

.header-bar .page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    color: var(--gold);
    font-style: italic;
    white-space: nowrap;
    text-align: center;
    z-index: 101;
    pointer-events: none;
}

.cam-container {
    width: 90%;
    max-width: 500px;
    margin: 30px auto;
    text-align: center;
}

.status-card {
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.status-icon.success {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-icon.error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.status-icon.pending {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

/* Floating Action Button (Camera) */
.fab-camera {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 1000;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(212, 175, 55, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    animation: fab-pulse 2.5s ease-in-out infinite;
}

.fab-camera:hover {
    transform: scale(1.1);
    box-shadow:
        0 8px 28px rgba(212, 175, 55, 0.55),
        0 3px 10px rgba(0, 0, 0, 0.35);
}

.fab-camera:active {
    transform: scale(0.92);
    animation: none;
}

@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45), 0 2px 8px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 6px 30px rgba(212, 175, 55, 0.7), 0 2px 12px rgba(0,0,0,0.25); }
}

#camera-file-input {
    display: none;
}

.live-gallery-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold);
    font-style: italic;
    margin: 40px 0 20px 0;
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 grid kolom dasar untuk pembagian ukuran kolase */
    gap: 25px -10px; /* Gap horizontal negatif agar polaroid bertumpuk estetik */
    margin-top: 25px;
    padding: 10px 8px;
    align-items: start; /* Mencegah item meregang tinggi secara vertikal jika ada foto yang lebih panjang di baris yang sama */
}

/* Ukuran Polaroid Bervariasi di Portrait */
.grid-item {
    grid-column: span 3; /* Default: Sedang (setengah lebar) */
    background-color: #fcfbf9; /* Putih kertas polaroid */
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 6px 6px 14px 6px; /* Dikurangi sedikit dari 18px agar area bawah putih sewajarnya polaroid */
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    position: relative;
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, z-index 0.2s;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Bikin variasi ukuran polaroid (Sedang & Kecil) agar tiap baris minimal berisi 2 foto */
.grid-item:nth-child(odd) {
    grid-column: span 3; /* Ukuran Sedang (50% lebar dasar) */
}
.grid-item:nth-child(even) {
    grid-column: span 3; /* Tetap span 3 untuk default, tapi diatur acak */
}
/* Mengganti beberapa anak agar berukuran lebih kecil (span 2 / 33% lebar) */
.grid-item:nth-child(3n) {
    grid-column: span 2; /* Ukuran Kecil */
}

@media (min-width: 600px) or (orientation: landscape) {
    .photo-grid {
        grid-template-columns: repeat(12, 1fr); /* 12 grid kolom dasar untuk mode landscape */
        gap: 25px -15px; /* Tumpukan sedikit lebih erat di landscape */
        padding: 10px 15px;
        align-items: start; /* Tetap gunakan align-items start di landscape */
    }
    .grid-item {
        grid-column: span 4; /* Default Landscape: Sedang */
    }
    .grid-item:nth-child(3n+1) {
        grid-column: span 5; /* Besar di Landscape */
    }
    .grid-item:nth-child(4n+2) {
        grid-column: span 3; /* Kecil di Landscape */
    }
}

.grid-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: block;
}

.grid-item:hover {
    transform: scale(1.2) rotate(0deg) !important; /* Efek membesar saat disentuh/di-hover */
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
}

/* Preview Modal */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    padding: 20px 15px calc(60px + env(safe-area-inset-bottom)) 15px;
}

.preview-card {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    flex-direction: column;
    text-align: left;
    margin: 20px auto;
    background: #151515;
}

.preview-img-container {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #000;
    position: relative;
}

.preview-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-actions {
    padding: 20px;
    background: #151515;
    display: flex;
    gap: 12px;
}

.preview-btn {
    flex: 1;
    height: 46px;
    border-radius: 23px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.preview-btn.cancel {
    background: #333;
    color: #fff;
}

.preview-btn.upload {
    background: var(--gold);
    color: #111;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Demo Bypass Button */
.demo-bypass-container {
    margin-top: 15px;
    text-align: center;
}

.demo-btn {
    background: transparent;
    border: 1px dashed var(--gold);
    color: var(--gold-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.demo-btn:hover {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Lightbox untuk live-cam */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox.is-active {
    opacity: 1;
}

.lightbox-main-container {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    transition: all 0.3s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Permission modal harus di atas segalanya */
#permission-modal {
    z-index: 3000;
}

/* Camera Modal Layout & Responsive Orientation */
.camera-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    background: #000;
    transition: all 0.3s ease;
    max-width: 500px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.camera-view-box {
    width: 100%;
    max-height: 100%;
    transition: all 0.3s ease;
}

.camera-controls-bar {
    position: absolute;
    bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 85%;
    flex-direction: row;
    transition: all 0.3s ease;
}

.rotatable-btn {
    transform: rotate(0deg);
    transition: transform 0.4s ease;
}

/* Portrait Orientation */
.camera-modal-container.orientation-portrait {
    max-width: 500px;
    flex-direction: column;
}
.camera-modal-container.orientation-portrait .camera-view-box {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3/4;
    height: auto;
    margin-bottom: 110px; /* Memastikan ruang kosong untuk tombol kontrol di bawah */
}
.camera-modal-container.orientation-portrait .camera-controls-bar {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    flex-direction: row;
}

/* Landscape Orientation - 90 deg (CCW) - Buttons on the right */
.camera-modal-container.orientation-landscape-90 {
    max-width: 100%;
    width: 100vw;
    height: 100dvh;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.camera-modal-container.orientation-landscape-90 .camera-view-box {
    width: 100%;
    max-width: min(calc(100vw - 160px), calc(80dvh * 4 / 3));
    aspect-ratio: 4/3;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}
.camera-modal-container.orientation-landscape-90 .camera-controls-bar {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    max-height: 420px;
    width: 80px;
    flex-direction: column-reverse;
    justify-content: space-between;
    align-items: center;
    bottom: auto;
    left: auto;
}

/* Landscape Orientation - 270 deg (CW) - Buttons on the left */
.camera-modal-container.orientation-landscape-270 {
    max-width: 100%;
    width: 100vw;
    height: 100dvh;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
}
.camera-modal-container.orientation-landscape-270 .camera-view-box {
    width: 100%;
    max-width: min(calc(100vw - 160px), calc(80dvh * 4 / 3));
    aspect-ratio: 4/3;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}
.camera-modal-container.orientation-landscape-270 .camera-controls-bar {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    max-height: 420px;
    width: 80px;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    bottom: auto;
    right: auto;
}

/* PC specific styling */
.is-pc #camera-flash-btn {
    transform: rotate(0deg) !important;
    transition: transform 0.4s ease;
}

/* --- OVERLAY ANIMATIONS & INTERACTIVE EFFECTS --- */
@keyframes polaroidDrop {
    0% {
        opacity: 0;
        transform: translateY(-80px) scale(0.7) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: var(--card-tilt, rotate(var(--random-rot, 0deg))) translateZ(0);
    }
}

.polaroid-drop {
    opacity: 0;
    animation: polaroidDrop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
    animation-delay: var(--stagger-delay, 0s);
    will-change: transform, opacity;
}

@keyframes polaroidDevelop {
    0% {
        filter: grayscale(1) brightness(0.25) contrast(0.6) blur(2px);
        opacity: 0.65;
    }
    40% {
        filter: grayscale(0.6) brightness(0.6) contrast(0.8) blur(0.5px);
        opacity: 0.85;
    }
    100% {
        filter: grayscale(0) brightness(1) contrast(1) blur(0);
        opacity: 1;
    }
}

.polaroid-image-develop {
    animation: polaroidDevelop 3s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
    will-change: filter, opacity;
}

/* Likes Heart Beat Animation */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

.heart-beat-active {
    animation: heartBeat 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- CAMERA TOUCH TO FOCUS RING --- */
.focus-ring {
    position: absolute;
    width: 65px;
    height: 65px;
    border: 1.5px solid #f1c40f;
    border-radius: 4px;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
    z-index: 2610;
    transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.15s ease;
    will-change: transform, opacity;
}
.focus-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #f1c40f;
    border-radius: 50%;
}
.focus-ring.active {
    transform: translate(-50%, -50%) scale(1.0);
    opacity: 1;
}

/* --- IMMERSIVE GALLERY ANIMATIONS --- */

/* 3D Perspective on Grid */
.photo-grid {
    perspective: 1000px;
}

/* 3D Tilt Card Base */
.grid-item {
    transform-style: preserve-3d;
    transform: var(--card-tilt, rotate(var(--random-rot, 0deg)));
    transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, z-index 0s;
    will-change: transform;
}

/* Override hover effect to support 3D lifting */
.grid-item:hover {
    transform: var(--card-hover-tilt, scale(1.15)) !important;
    z-index: 120 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
}

/* Heart Particle Burst */
.heart-particle {
    position: fixed;
    font-size: 1.4rem;
    pointer-events: none;
    z-index: 3100;
    user-select: none;
    -webkit-user-select: none;
    animation: heartFloat 0.9s cubic-bezier(0.175, 0.885, 0.32, 1) forwards;
    will-change: transform, opacity;
}

@keyframes heartFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--scale)) rotate(var(--rot));
        opacity: 0;
    }
}

/* Lightbox Smooth Zoom */
.lightbox {
    transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity;
}

/* Instagram-Style Vertical Scroll Feed */
.feed-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: #000000;
    -webkit-overflow-scrolling: touch;
}

/* Remove scrollbars for feed */
.feed-container::-webkit-scrollbar {
    display: none;
}

.feed-post {
    scroll-snap-align: start;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 10px;
    position: relative;
    background: #050505;
}

.feed-post-card {
    width: 100%;
    max-width: 420px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.feed-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #111;
    font-weight: bold;
}

.feed-post-meta {
    display: flex;
    flex-direction: column;
}

.feed-post-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.feed-post-time {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.feed-post-img-container {
    width: 100%;
    position: relative;
    background: #0b0b0b;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-post-img-container img {
    width: 100%;
    height: auto;
    max-height: 62vh;
    max-height: 62dvh;
    object-fit: contain;
    display: block;
}

/* Double-tap Center Heart Overlay */
.center-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 5rem;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(231, 76, 60, 0.6);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.4), opacity 0.3s ease;
    will-change: transform, opacity;
}

.center-heart.animate {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.1);
}

.feed-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px 16px;
}

.feed-post-actions-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feed-action-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    will-change: transform;
}

.feed-action-btn:active {
    transform: scale(0.8);
}

.feed-action-btn.like-btn.liked {
    color: #e74c3c;
    filter: drop-shadow(0 2px 6px rgba(231, 76, 60, 0.4));
}

.feed-post-info {
    padding: 0 16px 16px 16px;
    font-family: var(--font-body);
}

.feed-likes-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.feed-caption {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.feed-caption span {
    font-weight: 600;
    color: var(--gold-light);
    margin-right: 6px;
}

/* Dual-layer Slideshow styling updates */
.slideshow-polaroid {
    will-change: opacity, transform;
}

/* Ken Burns Slideshow Effect */
@keyframes kenBurns1 {
    0% {
        transform: translate(-50%, -50%) scale(0.96) rotate(-1deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.02) rotate(1deg);
    }
}

@keyframes kenBurns2 {
    0% {
        transform: translate(-50%, -50%) scale(1.02) rotate(1deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(0.96) rotate(-1deg);
    }
}

.slideshow-active-kb1 {
    animation: kenBurns1 5.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

.slideshow-active-kb2 {
    animation: kenBurns2 5.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

/* Fullscreen API overrides to prevent blank displays on desktop browsers */
#slideshow-overlay:-webkit-full-screen,
#slideshow-overlay:fullscreen {
    display: flex !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #050505 !important;
}

/* Polaroid Image Grid Loader & Shimmer Animation */
.polaroid-loader {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 14px; /* Leaves room for polaroid bottom white space padding */
    background: #151515;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    z-index: 5;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.polaroid-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer-load 1.6s infinite;
}

@keyframes shimmer-load {
    100% {
        transform: translateX(100%);
    }
}

.polaroid-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(212, 175, 55, 0.1);
    border-top: 2px solid var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 3D Mystery Flip Card for Highlights */
.highlight-card {
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.highlight-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.highlight-card.revealed .highlight-card-inner {
    transform: rotateY(180deg);
}

.highlight-card-front,
.highlight-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 50%;
}

.highlight-card-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.highlight-card-back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* Lens Selector Position below cam stream */
#camera-lens-selector {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 2505;
}

/* Landscape 90 deg (CCW) - Buttons on the right */
.camera-modal-container.orientation-landscape-90 #camera-lens-selector {
    bottom: auto;
    left: auto;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

/* Landscape 270 deg (CW) - Buttons on the left */
.camera-modal-container.orientation-landscape-270 #camera-lens-selector {
    bottom: auto;
    right: auto;
    left: 120px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

/* Camera Top Controls Bar */
.camera-top-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: calc(20px + env(safe-area-inset-top)) 15px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2502;
    box-sizing: border-box;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    pointer-events: none;
}

#camera-flash-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: auto;
    transition: background-color 0.2s;
}
#camera-flash-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#camera-timer-btn,
#camera-dual-btn {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 12px;
    height: 36px;
    border-radius: 18px;
    pointer-events: auto;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}
#camera-timer-btn:hover,
#camera-dual-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#camera-stream-sub {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 22%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    z-index: 2502;
    background: #000;
    touch-action: none; /* Disable default touch scroll gestures while dragging */
    overflow: hidden !important;
}

#camera-stream-sub.sub-shape-circle {
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
    mask-image: radial-gradient(white, black) !important;
}
#camera-stream-sub.sub-shape-4-3 {
    aspect-ratio: 4 / 3 !important;
    border-radius: 8px !important;
}
#camera-stream-sub.sub-shape-3-4 {
    aspect-ratio: 3 / 4 !important;
    border-radius: 8px !important;
}
#camera-stream-sub.sub-shape-1-1 {
    aspect-ratio: 1 / 1 !important;
    border-radius: 8px !important;
}

/* Landscape 90 deg (CCW) - Buttons on the right, top controls on the left */
.camera-modal-container.orientation-landscape-90 .camera-top-controls {
    top: 50%;
    left: 25px;
    right: auto;
    bottom: auto;
    width: 60px;
    height: auto;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0;
    background: none;
}

/* Landscape 270 deg (CW) - Buttons on the left, top controls on the right */
.camera-modal-container.orientation-landscape-270 .camera-top-controls {
    top: 50%;
    right: 25px;
    left: auto;
    bottom: auto;
    width: 60px;
    height: auto;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0;
    background: none;
}

/* --- AMBIENT GLOWING ORBS FOR VIRTUAL PHOTOBOOTH --- */
.live-cam-body .liquid-bg {
    z-index: 0;
    opacity: 0.95;
}

.live-cam-body .orb-1 {
    width: 80vw;
    height: 80vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, rgba(184, 134, 11, 0.06) 50%, rgba(0, 0, 0, 0) 70%);
    filter: blur(50px);
    -webkit-filter: blur(50px);
    top: -10%;
    left: -20%;
}

.live-cam-body .orb-2 {
    width: 70vw;
    height: 70vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(243, 229, 171, 0.16) 0%, rgba(212, 175, 55, 0.04) 50%, rgba(0, 0, 0, 0) 70%);
    filter: blur(55px);
    -webkit-filter: blur(55px);
    bottom: 5%;
    right: -15%;
    animation-delay: -5s;
}

/* --- 3D FLIP CAMERA ANIMATION --- */
.camera-view-box {
    perspective: 1000px;
}

.camera-stream-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s ease;
    will-change: transform, filter;
}

/* Step 1: Rotate to 90deg and blur */
.camera-stream-wrapper.flip-step-1 {
    transform: rotateY(90deg);
    filter: blur(12px);
}

/* Step 2: Instant snap to -90deg (no transition transition) */
.camera-stream-wrapper.flip-step-2 {
    transition: none !important;
    transform: rotateY(-90deg);
    filter: blur(12px);
}


