/* Camera Funhouse */

/* The app queries its own container width (not the viewport): the surrounding
   panel chrome resizes independently of the screen (framed vs maximized).
   A container query cannot style its own container, so .cf-app only measures
   and .cf-layout does the actual flex switching. */
.cf-app {
    height: 100%;
    container-type: inline-size;
    container-name: cfapp;
    /* App UI labels are controls, not content - stray clicks and drags on
       the desktop should never highlight them */
    -webkit-user-select: none;
    user-select: none;
}

.cf-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Stage */
.cf-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
}

/* The element always fills the stage (aspect-fit): render resolution can
   drop for performance without the on-screen image shrinking */
.cf-canvas,
.cf-preview-img,
.cf-preview-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cf-preview-img,
.cf-preview-video {
    display: none;
}

/* Overlay cards (welcome / error) */
.cf-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--gn-body-bg);
    overflow-y: auto;
    z-index: 2;
}

.cf-card {
    max-width: 480px;
    text-align: center;
    background-color: var(--gn-card-bg);
    border: 1px solid var(--gn-card-border);
    border-radius: 0.75rem;
    padding: 2rem;
    color: var(--gn-body-color);
}

.cf-card-icon {
    display: block;
    font-size: 2.5rem;
    color: var(--gn-accent);
    margin-bottom: 0.75rem;
}

.cf-privacy {
    font-size: 0.875rem;
    color: var(--gn-muted);
}

.cf-privacy .bi {
    color: var(--gn-accent);
    margin-right: 0.25rem;
}

/* Controls overlaid on the bottom of the stage (like phone camera apps):
   a single row with the capture button in the middle */
.cf-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1.5rem 0.75rem 0.875rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    z-index: 1;
}

/* Row control buttons share the thicker border of the resolution badge */
.cf-live-controls .btn-cf,
.cf-switch-top {
    border-width: 2px;
}

/* Live controls use absolute anchoring: the capture button is always dead
   center, adjust/effects pin to the edges, the mode switcher sits left of
   the shutter and the timer/length cluster to its right */
.cf-live-controls {
    height: 104px;
}

.cf-live-controls > * {
    position: absolute;
}

/* Centered via calc (not translateX) so the hover/active scale transform
   cannot displace the button */
.cf-live-controls .cf-capture {
    left: calc(50% - 32px);
    bottom: 0.875rem;
}

.cf-edge-left {
    left: 0.875rem;
    bottom: 1.5rem;
}

.cf-edge-right {
    right: 0.875rem;
    bottom: 1.5rem;
}

/* Frames button next to the effects button */
.cf-edge-right-2 {
    right: calc(0.875rem + 52px);
    bottom: 1.5rem;
}

/* Surprise button stacked above the effects button - only on narrow
   containers, where the side panel (with its own Surprise button) is gone */
.cf-live-controls .btn-cf.cf-surprise-stage {
    display: none;
    right: 0.875rem;
    bottom: calc(1.5rem + 52px);
}

/* Self timer: a round button stacked above the adjust button at the left
   edge, icon over the current value */
.cf-live-controls .cf-timer-left {
    left: 0.875rem;
    bottom: calc(1.5rem + 52px);
    width: 44px;
    height: 44px;
    padding: 0;
    border-width: 2px;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.cf-live-controls .cf-timer-left .bi {
    font-size: 0.9375rem;
    line-height: 1;
}

.cf-live-controls .cf-timer-left #cfTimerVal {
    font-size: 0.5625rem;
    line-height: 1;
}

/* Mode switcher: always shows the opposite of what the shutter captures */
.cf-mode-flip {
    right: calc(50% + 42px);
    bottom: 1.5rem;
}

.cf-right-cluster {
    left: calc(50% + 42px);
    bottom: 1.95rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Camera switcher pinned to the top-left of the stage */
.cf-switch-top {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
}

/* Cycle buttons: tap steps to the next value, always showing the current */
.cf-cycle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 2rem;
    background-color: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #eee;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.cf-cycle-btn[hidden] {
    display: none;
}

.cf-cycle-btn:hover {
    border-color: var(--gn-accent);
}

.cf-cycle-btn.active {
    background-color: var(--gn-accent);
    border-color: var(--gn-accent);
    color: #fff;
}

/* Narrow containers: compact row - smaller buttons, tighter offsets */
@container cfapp (max-width: 430px) {
    .cf-edge-left {
        left: 0.5rem;
    }

    .cf-edge-right {
        right: 0.5rem;
    }

    /* Narrow: frames stays beside effects, just tighter */
    .cf-live-controls .btn-cf.cf-edge-right-2 {
        right: calc(0.5rem + 44px);
    }

    .cf-live-controls .cf-timer-left {
        left: 0.5rem;
        bottom: calc(1.625rem + 48px);
        width: 40px;
        height: 40px;
    }

    .cf-live-controls .btn-cf.cf-surprise-stage {
        display: inline-flex;
        right: 0.5rem;
        bottom: calc(1.625rem + 48px);
    }

    /* Narrow containers: the side panel disappears entirely - the stage
       buttons and the chain stack cover everything it offered */
    .cf-layout .cf-panel {
        display: none;
    }

    .cf-mode-flip {
        right: calc(50% + 36px);
    }

    .cf-right-cluster {
        left: calc(50% + 36px);
        gap: 0.125rem;
    }

    .cf-cycle-btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .cf-live-controls .btn-cf {
        width: 40px;
        height: 40px;
        bottom: 1.625rem;
    }
}

/* Round icon buttons (mirror, switch camera, effects) - fixed light colors,
   they always sit on the dark scrim regardless of theme */
.btn-cf {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cf:hover {
    border-color: var(--gn-accent);
    color: var(--gn-accent);
}

.btn-cf.active {
    background-color: var(--gn-accent);
    border-color: var(--gn-accent);
    color: #fff;
}

/* Big round capture button; red accents in loop mode. The icon inside
   shows what the shutter captures (camera = photo, film = loop) */
.cf-capture {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid #fff;
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.1s, background-color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-capture .bi {
    font-size: 1.375rem;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.cf-capture[data-mode='loop'] {
    border-color: #dc3545;
}

.cf-capture[data-mode='loop']:hover {
    background-color: #dc3545;
}

.cf-capture:hover {
    background-color: var(--gn-accent);
    transform: scale(1.05);
}

.cf-capture:active {
    transform: scale(0.95);
}

/* Free-length recording in progress: the shutter is now a stop button */
.cf-capture.recording {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.45);
}

.cf-capture.recording:hover {
    background-color: #dc3545;
}

/* Effect browser: overlay on the stage with live preview tiles */
.cf-browser {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.82);
}

.cf-browser[hidden] {
    display: none;
}

.cf-browser-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cf-browser-title {
    color: #fff;
    font-weight: 600;
    padding: 0.25rem 0;
}

.cf-browser-title[hidden] {
    display: none;
}

.cf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.cf-tab {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: transparent;
    color: #eee;
    border-radius: 2rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.cf-tab:hover {
    border-color: var(--gn-accent);
}

.cf-tab.active {
    background-color: var(--gn-accent);
    border-color: var(--gn-accent);
    color: #fff;
}

.cf-tiles {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.625rem;
    align-content: start;
    padding-right: 0.25rem;
    scrollbar-width: thin;
}

.cf-tile {
    position: relative;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background-color: #111;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
}

.cf-tile:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.cf-tile.active {
    border-color: var(--gn-accent);
}

.cf-tile canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.cf-tile-name {
    display: block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-tile-check {
    display: none;
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    color: var(--gn-accent);
    font-size: 1.125rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.cf-tile.active .cf-tile-check {
    display: block;
}

/* Countdown overlay (self timer) */
.cf-countdown {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    pointer-events: none;
}

.cf-countdown[hidden] {
    display: none;
}

.cf-countdown-num {
    font-size: 6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.cf-countdown-hint {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Recording indicator (top center, clear of the camera switcher) */
.cf-rec {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.625rem;
    border-radius: 2rem;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.875rem;
}

.cf-rec[hidden] {
    display: none;
}

.cf-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #dc3545;
    animation: cf-blink 1s infinite;
}

@keyframes cf-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* Resolution / aspect badge (top-right on the stage, Pixect-style) */
.cf-resbadge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.375rem 0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.1;
}

.cf-resbadge:hover {
    border-color: var(--gn-accent);
}

.cf-resbadge-aspect {
    font-weight: 400;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

/* Stage popovers: quality/aspect under the badge (top-right) and image
   adjustments above the controls (bottom-left) - shared dark styling */
.cf-respop,
.cf-adjpop {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.85);
}

.cf-respop {
    top: 4rem;
    right: 0.75rem;
}

/* Anchored above its button at the left edge of the controls row */
.cf-adjpop {
    bottom: 5rem;
    left: 0.875rem;
    width: 220px;
}

.cf-respop[hidden],
.cf-adjpop[hidden] {
    display: none;
}

.cf-respop .cf-setting-label,
.cf-adjpop .cf-setting-label {
    color: rgba(255, 255, 255, 0.7);
}

.cf-respop .cf-seg-btn,
.cf-adjpop .cf-seg-btn {
    border-color: rgba(255, 255, 255, 0.3);
    color: #eee;
}

.cf-respop .cf-seg-btn:hover,
.cf-adjpop .cf-seg-btn:hover {
    border-color: var(--gn-accent);
}

.cf-respop .cf-seg-btn.active,
.cf-adjpop .cf-seg-btn.active {
    background-color: var(--gn-accent);
    border-color: var(--gn-accent);
    color: #fff;
}

/* Adjustment sliders */
.cf-adj-slider {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
}

.cf-adj-slider .form-range {
    margin-top: 0.125rem;
}

/* Mobile chain stack: one button per active effect, vertically centered
   on the stage's right edge. Tap opens the intensity popout, drag up/down
   reorders. Shown on narrow containers only - the side panel covers this
   on desktop. */
.cf-chain-stack {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.cf-stack-btn {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 0.625rem;
    background-color: #111;
    overflow: hidden;
    touch-action: none;
}

.cf-stack-btn.dragging {
    z-index: 2;
    border-color: var(--gn-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.cf-stack-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cf-stack-num {
    position: absolute;
    top: 1px;
    left: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Locked frame button at the bottom of the stack */
.cf-stack-frame {
    margin-top: 4px;
    touch-action: auto;
}

.cf-stack-frame .cf-stack-num .bi {
    font-size: 0.625rem;
}

/* Intensity popout sliding out to the left of the stack */
.cf-stack-pop {
    position: absolute;
    right: calc(0.5rem + 44px + 8px);
    transform: translateY(-50%);
    z-index: 2;
    width: 200px;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.85);
}

.cf-stack-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cf-stack-pop-name {
    color: #eee;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-stack-pop .btn-chain {
    color: #ccc;
}

.cf-stack-pop-trash:hover {
    color: #dc3545;
}

@container cfapp (max-width: 430px) {
    .cf-chain-stack {
        display: flex;
    }

    .cf-stack-pop:not([hidden]) {
        display: flex;
    }
}

/* Composition grid (rule of thirds) overlaying the canvas - UI only */
.cf-grid {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.45) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
    background-size: 33.334% 33.334%;
    background-position: -1px -1px;
}

.cf-grid[hidden] {
    display: none;
}

/* Setting rows (used inside the stage popovers) */
.cf-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cf-setting-label {
    flex: 0 0 52px;
    font-size: 0.8125rem;
    color: var(--gn-muted);
}

.cf-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.cf-seg-btn {
    border: 1px solid var(--gn-card-border);
    background-color: transparent;
    color: var(--gn-body-color);
    border-radius: 0.375rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.8125rem;
}

.cf-seg-btn:hover {
    border-color: var(--gn-accent);
}

.cf-seg-btn.active {
    background-color: var(--gn-accent);
    border-color: var(--gn-accent);
    color: #fff;
}

/* Effect chain panel */
.cf-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background-color: var(--gn-card-bg);
    border-top: 1px solid var(--gn-card-border);
    padding: 0.75rem;
    min-height: 0;
}

.cf-panel-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cf-chain-count {
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--gn-muted);
}

.cf-chain-count.pulse {
    animation: cf-pulse 0.5s;
    color: #dc3545;
}

@keyframes cf-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.cf-add-btn {
    margin-bottom: 0.75rem;
}

.cf-chain {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
}

.cf-chain-empty {
    color: var(--gn-muted);
    font-size: 0.875rem;
}

.cf-chain-item {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    background-color: var(--gn-body-bg);
    border: 1px solid var(--gn-card-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.cf-chain-item.dragging {
    opacity: 0.5;
}

/* Drag handle: two elongated vertical bars spanning the row's left edge */
.cf-chain-grip {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    flex: 0 0 auto;
    color: var(--gn-muted);
    cursor: grab;
}

.cf-chain-grip::before {
    content: '';
    width: 7px;
    height: 70%;
    min-height: 22px;
    border-left: 2px solid currentColor;
    border-right: 2px solid currentColor;
    opacity: 0.6;
}

.cf-chain-grip:hover::before {
    opacity: 1;
}

.cf-chain-grip:active {
    cursor: grabbing;
}

.cf-chain-main {
    flex: 1 1 auto;
    min-width: 0;
}

.cf-chain-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cf-chain-name {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-chain-tools {
    display: flex;
    gap: 0.125rem;
    flex: 0 0 auto;
}

.btn-chain {
    border: 0;
    background: none;
    color: var(--gn-muted);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1;
}

.btn-chain:hover:not(:disabled) {
    color: var(--gn-body-color);
    background-color: var(--gn-sidebar-hover-bg);
}

.btn-chain:disabled {
    opacity: 0.3;
}

.cf-chain-slider {
    margin-top: 0.25rem;
}

.cf-panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Active frame row (below the chain; not a chain item, no reordering) */
.cf-frame-row {
    background-color: var(--gn-body-bg);
    border: 1px solid var(--gn-card-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    flex: 0 0 auto;
}

.cf-frame-row[hidden] {
    display: none;
}

.cf-frame-param {
    display: block;
    font-size: 0.75rem;
    color: var(--gn-muted);
    margin-top: 0.25rem;
}

.cf-frame-param[hidden] {
    display: none;
}

.cf-frame-param .cf-chain-slider {
    margin-top: 0.125rem;
}

/* Narrow containers: the chain sits below the stage with a capped height */
.cf-chain {
    max-height: 180px;
}

/* Wide container: fixed 320px effect panel to the right of the stage */
@container cfapp (min-width: 900px) {
    .cf-layout {
        flex-direction: row;
    }

    .cf-panel {
        flex: 0 0 320px;
        border-top: 0;
        border-left: 1px solid var(--gn-card-border);
    }

    .cf-chain {
        max-height: none;
    }
}

/* Focus visibility for keyboard users */
.cf-tab:focus-visible,
.cf-tile:focus-visible,
.btn-cf:focus-visible,
.btn-chain:focus-visible,
.cf-capture:focus-visible {
    outline: 2px solid var(--gn-accent);
    outline-offset: 2px;
}

/* State-driven visibility */
.cf-app[data-state='welcome'] .cf-panel,
.cf-app[data-state='error'] .cf-panel,
.cf-app[data-state='preview'] .cf-panel,
.cf-app[data-state='welcome'] .cf-controls,
.cf-app[data-state='error'] .cf-controls,
.cf-app[data-state='welcome'] .cf-resbadge,
.cf-app[data-state='error'] .cf-resbadge,
.cf-app[data-state='preview'] .cf-resbadge,
.cf-app[data-state='welcome'] .cf-grid,
.cf-app[data-state='error'] .cf-grid,
.cf-app[data-state='preview'] .cf-grid,
.cf-app[data-state='welcome'] .cf-switch-top,
.cf-app[data-state='error'] .cf-switch-top,
.cf-app[data-state='preview'] .cf-switch-top,
.cf-app[data-state='welcome'] .cf-chain-stack,
.cf-app[data-state='error'] .cf-chain-stack,
.cf-app[data-state='preview'] .cf-chain-stack,
.cf-app[data-state='welcome'] .cf-stack-pop,
.cf-app[data-state='error'] .cf-stack-pop,
.cf-app[data-state='preview'] .cf-stack-pop,
.cf-app[data-state='welcome'] .cf-error,
.cf-app[data-state='error'] .cf-welcome,
.cf-app[data-state='live'] .cf-overlay,
.cf-app[data-state='preview'] .cf-overlay,
.cf-app[data-state='preview'] .cf-canvas,
.cf-app[data-state='preview'] .cf-live-controls,
.cf-app[data-state='live'] .cf-preview-controls {
    display: none;
}

.cf-app[data-state='preview'][data-capture='photo'] .cf-preview-img {
    display: block;
}

.cf-app[data-state='preview'][data-capture='loop'] .cf-preview-video {
    display: block;
}

/* Download buttons follow the capture type */
.cf-app[data-capture='loop'] .cf-dl-photo,
.cf-app[data-capture='photo'] .cf-dl-loop {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .cf-capture,
    .cf-chip,
    .btn-cf {
        transition: none;
    }

    .cf-chain-count.pulse,
    .cf-rec-dot {
        animation: none;
    }
}
