:root {
    /* Color Tokens - Dark (Default) */
    --primary-color: #9BC440;
    --primary-hover: #86AA37;
    --bg-gradient: #4d4d4b;
    --card-bg: rgba(0, 0, 0, 0.5);
    --card-bg-solid: #000000;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --radius-lg: 32px;
    --radius-md: 20px;
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    --glass-blur: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    min-width: 100%;
    min-height: 100%;
    background: #0b0c0c;
    overflow: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at 68% 12%, rgba(155, 196, 64, 0.18), transparent 26%),
        radial-gradient(circle at 8% 88%, rgba(155, 196, 64, 0.08), transparent 28%),
        url("data:image/svg+xml,%3Csvg width='900' height='640' viewBox='0 0 900 640' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%239BC440' stroke-opacity='.16' stroke-width='1'%3E%3Cpath d='M-120 610C70 610 98 438 270 438s230 164 414 164 210-196 368-196'/%3E%3Cpath d='M-120 582C68 582 104 408 278 408s224 164 406 164 206-196 366-196'/%3E%3Cpath d='M-120 554C68 554 110 378 286 378s218 164 398 164 204-196 364-196'/%3E%3Cpath d='M-120 526C70 526 116 348 294 348s212 164 390 164 202-196 362-196'/%3E%3Cpath d='M-120 498C72 498 122 318 302 318s206 164 382 164 200-196 360-196'/%3E%3Cpath d='M-120 470C74 470 128 288 310 288s200 164 374 164 198-196 358-196'/%3E%3Cpath d='M-120 442C76 442 134 258 318 258s194 164 366 164 196-196 356-196'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.12), transparent 34%),
        radial-gradient(circle at 50% 110%, rgba(0, 0, 0, 0.55), transparent 44%),
        #4d4d4b;
    background-position: center, center, center bottom, center, center, center;
    background-size: auto, auto, cover, auto, auto, auto;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    padding: 24px;
    overflow: hidden;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

@media (max-width: 400px) {
    body {
        padding: 16px 12px;
    }
}

/* Background dot pattern — always covers the viewport */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1080'%3E%3Cdefs%3E%3Cpattern id='d' width='32' height='32' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='16' cy='16' r='1.4' fill='rgba(255%2C255%2C255%2C0.09)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23d)'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    z-index: 0;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 520px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards ease-out alternate;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    margin-bottom: 2vh;
    flex-shrink: 0;
}

header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    transition: opacity 0.5s ease;
}

header h1.fade-status {
    opacity: 0.3;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 3vh 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 2vh;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10;
}

.card:hover {
    transform: none;
}

.actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.image-wrapper {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    clip-path: inset(0 round var(--radius-md));
    transform: translateZ(0);
    isolation: isolate;
    background-color: rgba(0, 0, 0, 0.05);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.image-wrapper.loading-active {
    background: #030404;
    isolation: isolate;
    --loader-angle: 27deg;
}

.image-wrapper.loading-active::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--radius-md) - 3px);
    pointer-events: none;
    z-index: 43;
    padding: 2px;
    background:
        conic-gradient(
            from var(--loader-angle),
            transparent 0deg,
            transparent 246deg,
            rgba(155, 196, 64, 0.00) 258deg,
            rgba(155, 196, 64, 0.25) 274deg,
            rgba(194, 255, 94, 0.92) 288deg,
            rgba(155, 196, 64, 0.30) 303deg,
            transparent 322deg,
            transparent 360deg
        );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow:
        inset 0 0 18px rgba(155, 196, 64, 0.14),
        inset 0 0 42px rgba(155, 196, 64, 0.06);
    filter: drop-shadow(0 0 5px rgba(155, 196, 64, 0.26));
    animation: loading-frame-orbit 8.5s linear infinite;
    opacity: 0;
}

.image-wrapper.loading-active.loading-complete::before {
    animation: loading-frame-orbit-complete 8.5s linear forwards;
}

@property --loader-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes loading-frame-orbit {
    0% {
        --loader-angle: 27deg;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    58% {
        --loader-angle: 432deg;
        opacity: 1;
    }

    64.7% {
        --loader-angle: 477deg;
        opacity: 0;
    }

    100% {
        --loader-angle: 477deg;
        opacity: 0;
    }
}

@keyframes loading-frame-orbit-complete {
    0% {
        --loader-angle: 27deg;
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    90% {
        --loader-angle: 432deg;
        opacity: 1;
    }

    100% {
        --loader-angle: 477deg;
        opacity: 0;
    }
}

.preview-image {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: cover;
    border-radius: inherit;
    clip-path: inset(0 round var(--radius-md));
    transform: translateZ(0);
    opacity: 0;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out, filter 1.2s ease-out;
    filter: blur(10px);
}

.preview-image.ready {
    display: block;
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    z-index: 50;
    /* Über dem Overlay (40) */
    position: relative;
    pointer-events: auto;
    animation: reveal-zoom 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes reveal-zoom {
    0% {
        transform: scale(0.9) translateY(20px);
        filter: blur(15px) brightness(2);
        opacity: 0;
    }

    15% {
        opacity: 1;
        filter: blur(10px) brightness(1.5);
    }

    100% {
        transform: scale(1) translateY(0);
        filter: blur(0) brightness(1);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--card-bg-solid);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
    /* Über allem anderen Content */
    gap: 16px;
    opacity: 1;
    transition: opacity 0.9s ease, background-color 0.9s ease;
}

.loading-overlay.fade-out {
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    border-radius: var(--radius-md);
    /* Keine generelle Opacity 0 hier, sonst sieht man den Poof nicht! */
}

.loading-overlay.fade-out .loader-icon.icon-cloud {
    animation: cloud-poof 1.2s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 20;
    background: transparent !important;
    /* WICHTIG: Hintergrund entfernen! */
    box-shadow: none !important;
}

.loading-overlay.fade-out .loader-icon.icon-fotobox,
.loading-overlay.fade-out .transfer-path,
.loading-overlay.fade-out .loader-status {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transition: all 0.1s ease-out;
    /* Fast hide to clear space for the cloud */
}

@keyframes cloud-poof {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0) brightness(1);
    }

    15% {
        transform: scale(1.6) rotate(10deg);
        opacity: 0.9;
        filter: blur(2px) brightness(1.8);
    }

    40% {
        transform: scale(2.8) rotate(-5deg) translateY(-30px);
        opacity: 0.5;
        filter: blur(10px) brightness(1.2);
    }

    100% {
        transform: scale(5) rotate(5deg) translateY(-180px);
        opacity: 0;
        filter: blur(50px);
    }
}

/* Capture & Cloud Loader */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* Reduced gap for top text */
}

.capture-cloud-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    position: relative;
}

.loader-icon {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
    transition: all 0.3s ease;
    background: var(--card-bg-solid);
    /* Solid background to mask rocket */
    border-radius: 50%;
    padding: 12px;
    z-index: 2;
    /* In front of rocket */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-fotobox {
    animation: pulse-simple 2.5s infinite ease-in-out;
    filter: drop-shadow(0 0 12px rgba(155, 196, 64, 0.25));
    padding: 20px;
    /* Make the icon smaller in its circle */
}

.icon-cloud {
    animation: float-cloud 4s infinite ease-in-out, cloud-flash 2.5s infinite;
}

.icon-cloud.pulse-impact {
    animation: impact-bloom 0.8s forwards ease-out;
    color: #fff !important;
}

.transfer-path {
    width: 120px;
    height: 2px;
    background: transparent;
    position: relative;
    overflow: visible;
}

.data-rocket {
    position: absolute;
    top: 50%;
    left: -40px;
    width: 12px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 1px;
    transform: translateY(-50%);
    /* Subtle glow as requested */
    box-shadow: 0 0 8px rgba(155, 196, 64, 0.4);
    filter: none;
    animation: rocket-flight 2.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
    z-index: 1;
    /* Behind icons */
}

@keyframes rocket-flight {
    0% {
        left: -80px;
        /* Hidden behind Fotobox */
        opacity: 0;
    }

    15% {
        opacity: 0;
    }

    20% {
        opacity: 1;
        /* Emerge from Fotobox */
    }

    75% {
        left: 200px;
        /* Impact cloud center */
        opacity: 1;
    }

    76% {
        opacity: 0;
        /* Vanish behind cloud instantly on impact */
    }

    100% {
        left: 200px;
        opacity: 0;
    }
}

@keyframes impact-bloom {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(155, 196, 64, 0.2));
    }

    30% {
        transform: scale(1.4);
        filter: drop-shadow(0 0 40px var(--primary-color)) brightness(1.5);
    }

    100% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 20px var(--primary-color)) brightness(1.2);
    }
}

@keyframes cloud-flash {

    0%,
    74% {
        filter: drop-shadow(0 0 10px rgba(155, 196, 64, 0.2));
        color: var(--primary-color);
        transform: scale(1) translateY(0);
    }

    75% {
        /* Impact moment - starting slow bloom, reduced spread */
        filter: drop-shadow(0 0 18px var(--primary-color)) brightness(1.15);
        color: #fff;
        transform: scale(1.08) translateY(-2px);
    }

    85% {
        /* Peak of slower flash, but less overwhelming spread */
        filter: drop-shadow(0 0 28px var(--primary-color)) brightness(1.3);
        color: #fff;
        transform: scale(1.15) translateY(-5px);
    }

    95%,
    100% {
        filter: drop-shadow(0 0 10px rgba(155, 196, 64, 0.2));
        color: var(--primary-color);
        transform: scale(1) translateY(0);
    }
}

@keyframes float-cloud {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes pulse-simple {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(155, 196, 64, 0.4));
    }

    50% {
        transform: scale(1.08);
        opacity: 0.9;
        filter: drop-shadow(0 0 25px rgba(155, 196, 64, 0.6));
    }
}

.loader-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.dots-container {
    display: inline-flex;
    width: 24px;
    text-align: left;
}

.dot-anim {
    animation: dot-flicker 1.5s infinite;
    opacity: 0;
}

.dot-anim:nth-child(2) {
    animation-delay: 0.3s;
}

.dot-anim:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dot-flicker {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 0.75s ease, filter 0.75s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 8px 16px rgba(155, 196, 64, 0.3);
}

html.can-hover .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(155, 196, 64, 0.4);
}

video.preview-image {
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Action Buttons (Like / Share) */
.btn-action {
    width: 52px;
    height: 52px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.75s ease, filter 0.75s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    color: var(--primary-color);
    flex-shrink: 0;
    padding: 0;
}

.actions.revealing .btn,
.actions.revealing .btn-action {
    opacity: 1 !important;
    filter: saturate(1);
}

.btn-action svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

html.can-hover .btn-action:hover:not(:disabled):not(.pop) {
    transform: translateY(-3px) scale(1.08);
    border-color: rgba(155, 196, 64, 0.45);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
}

.btn-like.liked {
    background: rgba(155, 196, 64, 0.16);
    border-color: rgba(155, 196, 64, 0.45);
    color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(155, 196, 64, 0.25);
}

html.can-hover .btn-like.liked:hover:not(:disabled) {
    box-shadow: 0 8px 22px rgba(155, 196, 64, 0.36);
    border-color: rgba(155, 196, 64, 0.65);
}

@keyframes like-pop {
    0%   { transform: translateY(0) scale(1); }
    45%  { transform: translateY(0) scale(1.12); }
    100% { transform: translateY(0) scale(1); }
}

.btn-like.pop {
    animation: like-pop 0.22s ease-out;
}

/* Share toast notification */
.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(90px);
    background: var(--card-bg-solid);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Outfit', sans-serif;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Stats Styles */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 14px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    width: 100%;

    /* Animation initial state */
    opacity: 0;
    transform: translateY(-40px);
    z-index: 20;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.stats-container.reveal {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.stat-header svg {
    width: 18px;
    height: 18px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
    fill: none;
}

@media (max-width: 400px) {
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

footer {
    margin-top: 2vh;
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .capture-cloud-loader {
        transform: scale(0.75);
    }

    .btn-action {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 1.75rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .card {
        padding: 16px;
        gap: 20px;
    }

    .actions {
        gap: 8px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.92rem;
        gap: 8px;
    }

    .btn-action {
        width: 46px;
        height: 46px;
    }

    .capture-cloud-loader {
        transform: scale(0.65);
    }
}

@media (max-width: 340px) {
    header h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.88rem;
        gap: 6px;
    }

    .actions {
        gap: 6px;
    }

    .btn-action {
        width: 40px;
        height: 40px;
    }

    .btn-action svg {
        width: 17px;
        height: 17px;
    }

    .capture-cloud-loader {
        transform: scale(0.55);
    }

    .stats-container {
        padding: 12px;
        gap: 16px;
        margin-top: 20px;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    background: #000;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

/* Lightbox Actions */
.lightbox-actions {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    z-index: 1010;
}

.lightbox-actions .lightbox-btn {
    order: 0;
}

#lightboxLike {
    order: 1;
}

#lightboxShare {
    order: 2;
}

#lightboxDownload {
    order: 3;
}

#lightboxClose {
    order: 4;
}

.lightbox-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.lightbox-btn.btn-like.liked {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

html.can-hover .lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-btn svg {
    width: 20px;
    height: 20px;
}

.image-wrapper {
    cursor: pointer;
}

/* Hide scrollbar when lightbox is active */
body.lightbox-open {
    overflow: hidden;
}

/* Download detail layout with template background */
body {
    background:
        radial-gradient(circle at 66% 16%, rgba(155, 196, 64, 0.18), transparent 24%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.07), transparent 34%),
        radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.58), transparent 46%),
        linear-gradient(135deg, #0b0c0c 0%, #151716 52%, #080909 100%);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow: hidden;
    overflow-x: hidden;
    align-items: center;
}

body::before {
    background-image: url("data:image/svg+xml,%3Csvg width='1440' height='960' viewBox='0 0 1440 960' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%239BC440' stroke-opacity='.105' stroke-width='.75'%3E%3Cpath d='M-220 820C18 820 42 596 250 596s300 206 522 206 282-244 496-244 274 120 420 120'/%3E%3Cpath d='M-220 792C20 792 50 568 260 568s292 206 512 206 278-244 492-244 274 120 420 120'/%3E%3Cpath d='M-220 764C22 764 58 540 270 540s284 206 502 206 274-244 488-244 274 120 420 120'/%3E%3Cpath d='M-220 736C24 736 66 512 280 512s276 206 492 206 270-244 484-244 274 120 420 120'/%3E%3Cpath d='M-220 708C26 708 74 484 290 484s268 206 482 206 266-244 480-244 274 120 420 120'/%3E%3Cpath d='M-220 680C28 680 82 456 300 456s260 206 472 206 262-244 476-244 274 120 420 120'/%3E%3Cpath d='M-220 652C30 652 90 428 310 428s252 206 462 206 258-244 472-244 274 120 420 120'/%3E%3Cpath d='M-220 624C32 624 98 400 320 400s244 206 452 206 254-244 468-244 274 120 420 120'/%3E%3Cpath d='M-220 596C34 596 106 372 330 372s236 206 442 206 250-244 464-244 274 120 420 120'/%3E%3C/g%3E%3C/svg%3E");
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 1;
}

.container {
    max-width: min(680px, 100%);
    height: 100%;
    max-height: 100%;
    justify-content: center;
    padding: clamp(10px, 2.6vh, 30px) 0;
}

.card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    gap: clamp(12px, 2.2vh, 24px);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.hero-copy h1 {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: clamp(1.55rem, min(5.8vw, 5vh), 3rem);
    line-height: 1.18;
    padding-bottom: 0.08em;
    font-weight: 700;
    color: var(--text-main);
}

.hero-copy h1 span {
    color: var(--primary-color);
}

#loadingTitleText {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    color: var(--text-main);
    will-change: transform, opacity;
}

#loadingTitleText span {
    color: var(--primary-color);
}

#loadingTitleText.title-slide {
    animation: loading-title-slide 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes loading-title-slide {
    0% {
        opacity: 0;
        transform: translateY(-70%);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-copy p {
    color: var(--text-main);
    font-size: clamp(0.98rem, 2.5vw, 1.1rem);
    font-weight: 500;
}

.image-wrapper {
    width: min(100%, 560px);
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

@supports (-webkit-touch-callout: none) {
    html,
    body {
        min-height: -webkit-fill-available;
    }

    body {
        background-color: #0b0c0c;
    }

    body::before {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .image-wrapper {
        overflow: hidden;
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        clip-path: inset(0 round var(--radius-md));
    }

    .preview-image,
    video.preview-image {
        border-radius: var(--radius-md);
        clip-path: inset(0 round var(--radius-md));
        -webkit-mask-image: -webkit-radial-gradient(white, black);
    }
}

.actions {
    width: min(100%, 560px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 1.55fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.btn {
    justify-content: center;
    min-height: 58px;
    min-width: 0;
}

.btn-action-label {
    display: inline;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    color: #ffffff;
}

.btn-action {
    width: 100%;
    min-width: 0;
    height: 58px;
    border-radius: var(--radius-md);
    gap: 10px;
    padding: 0 14px;
}

.stats-container {
    width: min(100%, 560px);
    margin-inline: auto;
    padding: 18px 16px;
}

.stat-item {
    gap: 5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 500;
}

@media (max-width: 560px) {
    body {
        align-items: center;
        padding: 14px 12px;
    }

    .container {
        height: 100%;
        min-height: 0;
        max-height: 100%;
        justify-content: center;
        padding: 0;
    }

    .hero-copy {
        gap: 8px;
    }

    .hero-copy h1 {
        font-size: clamp(1.2rem, 7vw, 2.05rem);
    }

    .image-wrapper {
        width: 100%;
        border-radius: 12px;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
    }

    .btn-primary {
        grid-column: 1 / -1;
        order: 1;
        width: 100%;
        min-height: 56px;
    }

    .btn-like {
        order: 2;
    }

    .btn-share {
        order: 3;
    }

    .btn-action {
        width: 100%;
        height: 54px;
        border-radius: var(--radius-md);
        gap: 10px;
    }

    .btn-action-label {
        font-weight: 700;
        color: #ffffff;
        white-space: nowrap;
    }

    .stats-container {
        margin-top: 20px;
        padding: 14px 10px;
        gap: 0;
    }

    .stat-item {
        min-width: 0;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: clamp(0.68rem, 3vw, 0.78rem);
    }

    footer {
        margin-top: clamp(10px, 1.8vh, 18px);
    }
}

@media (max-width: 360px) {
    body {
        padding-inline: 10px;
    }

    .hero-copy h1 {
        font-size: clamp(1.05rem, 7vw, 1.45rem);
    }

    .btn,
    .btn-action {
        font-size: 0.86rem;
    }

    .stats-container {
        padding-inline: 6px;
    }
}

@media (max-width: 480px) {
    .lightbox-actions {
        top: 16px;
        right: 16px;
    }

    .lightbox-btn {
        width: 40px;
        height: 40px;
    }
}

@media (hover: none), (pointer: coarse) {
    .btn,
    .btn-action,
    .lightbox-btn {
        transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    }

    .btn-primary:hover {
        background-color: var(--primary-color);
        transform: none;
        box-shadow: 0 8px 16px rgba(155, 196, 64, 0.3);
    }

    .btn-action:hover:not(:disabled):not(.pop) {
        transform: none;
        border-color: var(--card-border);
        box-shadow: none;
        color: var(--primary-color);
    }

    .btn-like.liked:hover:not(:disabled) {
        background: rgba(155, 196, 64, 0.16);
        border-color: rgba(155, 196, 64, 0.45);
        box-shadow: 0 4px 14px rgba(155, 196, 64, 0.25);
        color: var(--primary-color);
    }

    .lightbox-btn:hover,
    .lightbox-btn.btn-like.liked:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: none;
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
}
