*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #2d3250;
    --navy-rgb: 45, 50, 80;
    --navy2: #222640;
    --navy2-rgb: 34, 38, 64;
    --violet: #676f9d;
    --violet-rgb: 103, 111, 157;
    --peach: #f9b17a;
    --peach-rgb: 249, 177, 122;
    --coral: #ff7e67;
    --coral-rgb: 255, 126, 103;
    --teal: #7fb5b5;
    --teal-rgb: 127, 181, 181;
    --bg: #07111e;
    --slide-duration: 7s;
    --fade-duration: 1.2s;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: 'Poppins', sans-serif;
    color: #fff;
}

/* ── BOKEH BACKGROUND ─────────────────────────────────────── */
.stage {
    position: fixed;
    inset: -150px;
    z-index: 0;
    background: radial-gradient(ellipse 120% 100% at 50% 115%, #132d43 0%, var(--bg) 80%);
    overflow: hidden;
    pointer-events: none;
}

/* Individual bokeh circles */
.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(65px);
    opacity: 0;
    animation: bokehFloat linear infinite;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.bokeh:nth-child(1) {
    width: 600px;
    height: 600px;
    background: rgba(var(--teal-rgb), .55);
    top: -10%;
    left: -8%;
    animation-duration: 18s;
    animation-delay: 0s;
}

.bokeh:nth-child(2) {
    width: 450px;
    height: 450px;
    background: rgba(var(--peach-rgb), .5);
    top: 60%;
    right: -5%;
    animation-duration: 22s;
    animation-delay: -6s;
}

.bokeh:nth-child(3) {
    width: 520px;
    height: 520px;
    background: rgba(var(--teal-rgb), .45);
    top: 30%;
    left: 50%;
    animation-duration: 26s;
    animation-delay: -11s;
}

.bokeh:nth-child(4) {
    width: 350px;
    height: 350px;
    background: rgba(var(--peach-rgb), .42);
    top: 80%;
    left: 20%;
    animation-duration: 20s;
    animation-delay: -3s;
}

.bokeh:nth-child(5) {
    width: 650px;
    height: 650px;
    background: rgba(127, 181, 181, .35);
    top: -20%;
    left: 40%;
    animation-duration: 30s;
    animation-delay: -15s;
}

.bokeh:nth-child(6) {
    width: 300px;
    height: 300px;
    background: rgba(249, 177, 122, .45);
    top: 10%;
    right: 15%;
    animation-duration: 16s;
    animation-delay: -8s;
}

.bokeh:nth-child(7) {
    width: 400px;
    height: 400px;
    background: rgba(127, 181, 181, .48);
    top: 55%;
    left: 5%;
    animation-duration: 24s;
    animation-delay: -2s;
}

.bokeh:nth-child(8) {
    width: 480px;
    height: 480px;
    background: rgba(249, 177, 122, .38);
    top: 15%;
    left: 70%;
    animation-duration: 28s;
    animation-delay: -18s;
}

@keyframes bokehFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1.25);
    }
}

/* Subtle horizontal light sweep */
.sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(127, 181, 181, .08) 50%, transparent 70%);
    animation: sweepAnim 8s ease-in-out infinite alternate;
}

@keyframes sweepAnim {
    from {
        transform: translateX(-15%) rotate(-5deg);
    }

    to {
        transform: translateX(15%) rotate(5deg);
    }
}

/* ── PHOTO FRAME ──────────────────────────────────────────── */
.photo-stage {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Minimal safe area for clean layout */
    padding: 0;
}

/* Two photo slots for crossfade */
.photo-slot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.photo-slot img,
.photo-slot video {
    width: 90vw;
    height: 90vh;
    object-fit: contain;
    will-change: transform, opacity;
}

/* Hide default mobile video overlays & controls */
video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}

video::-webkit-media-controls {
    display: none !important;
}

/* ── ENTRANCE ANIMATIONS ──────────────────────────────────── */
@keyframes photoEnter {
    0% {
        opacity: 0;
        transform: scale(.95) rotate(-1deg);
        filter: blur(8px) brightness(.7);
    }

    15% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.05) rotate(0.5deg);
        filter: blur(0px) brightness(1);
    }
}

@keyframes photoEnter2 {
    0% {
        opacity: 0;
        transform: scale(1.05) rotate(1deg);
        filter: blur(8px) brightness(.7);
    }

    15% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }

    100% {
        opacity: 1;
        transform: scale(.95) rotate(-0.5deg);
        filter: blur(0px) brightness(1);
    }
}

@keyframes photoEnter3 {
    0% {
        opacity: 0;
        transform: scale(1) translateY(30px);
        filter: blur(10px) brightness(.6);
    }

    15% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.04) translateY(-20px);
        filter: blur(0px) brightness(1);
    }
}

@keyframes photoEnter4 {
    0% {
        opacity: 0;
        transform: scale(1.08) rotate(1.5deg);
        filter: blur(12px) brightness(.5);
    }

    15% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(-1.5deg);
        filter: blur(0px) brightness(1);
    }
}

@keyframes photoLeave {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: scale(1.06);
        filter: blur(4px);
    }
}

/* Video static fade (no movement) */
@keyframes videoFade {
    0% {
        opacity: 0;
        filter: blur(10px) brightness(.7);
    }

    15% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }

    100% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }
}

.photo-slot.active {
    opacity: 1;
    pointer-events: all;
}

.photo-slot.leaving img,
.photo-slot.leaving video {
    animation: photoLeave var(--fade-duration) ease forwards;
}

/* ── GLOW RING (decorative) ────────────────────────────────── */
.glow-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(127, 181, 181, .15);
    pointer-events: none;
    animation: ringPulse 4s ease-in-out infinite;
}

.glow-ring:nth-child(1) {
    width: 90vmin;
    height: 90vmin;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0s;
}

.glow-ring:nth-child(2) {
    width: 70vmin;
    height: 70vmin;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 1.3s;
}

@keyframes ringPulse {

    0%,
    100% {
        opacity: .4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: .12;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ── LOGO — TOP RIGHT ──────────────────────────────────────── */
.logo-corner {
    position: fixed;
    top: 2rem;
    right: 2.5rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .3rem;
    opacity: 0;
    animation: fadeShift 1s ease forwards 1s;
}

.logo-corner img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
}

.logo-corner span {
    font-size: 1rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
}

/* ── ALBUM TITLE — BOTTOM LEFT ─────────────────────────────── */
.brand {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 4rem 5rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background: linear-gradient(transparent, rgba(7, 17, 30, .85));
    pointer-events: none;
}

.brand-album {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.brand-label {
    font-size: 1rem;
    letter-spacing: .2rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
}

.brand-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .6);
}

/* ── COUNTER  TOP LEFT ─────────────────────────────────────── */
.counter {
    position: fixed;
    top: 2rem;
    left: 2.5rem;
    z-index: 50;
    font-size: 1.2rem;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .28);
    opacity: 0;
    animation: fadeShift 1s ease forwards 1.2s;
}

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.progress {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--teal), var(--peach));
    z-index: 60;
    transition: width var(--slide-duration) linear;
}

/* ── NEW PHOTO BADGE ───────────────────────────────────────── */
.new-badge {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 60;
    background: rgba(var(--teal-rgb), .15);
    border: 1px solid rgba(var(--teal-rgb), .45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: .5rem 1.4rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: .08em;
    display: flex;
    align-items: center;
    gap: .45rem;
    opacity: 0;
    transition: opacity .5s, transform .5s;
    pointer-events: none;
}

.new-badge.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.new-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--teal);
    border-radius: 50%;
    animation: dotPulse 1.6s ease infinite;
}

@keyframes dotPulse {

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

    50% {
        opacity: .3;
        transform: scale(.5);
    }
}

/* ── LOADER (Modern & Elegant) ────────────────────────────────────────────────── */
.loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(45, 50, 80, 0.98), rgba(34, 38, 64, 1));
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    transition: opacity .8s ease;
}

.loader.done {
    opacity: 0;
    pointer-events: none;
}

.loader img {
    height: 44px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
    animation: breathe 2.2s ease infinite;
}

@keyframes breathe {
    0%,
    100% {
        opacity: .7;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

.loader-text {
    font-size: 1.2rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-dots {
    display: flex;
    gap: 6px;
}

.loader-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, var(--teal), var(--peach));
    border-radius: 50%;
    opacity: .4;
    animation: dotBounce 1.2s ease infinite;
}

.loader-dots span:nth-child(2) {
    animation-delay: .2s;
    background: linear-gradient(135deg, var(--peach), var(--coral));
}

.loader-dots span:nth-child(3) {
    animation-delay: .4s;
    background: linear-gradient(135deg, var(--coral), var(--teal));
}

@keyframes dotBounce {
    0%,
    100% {
        opacity: .3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

/* Error */
.error-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
}

.error-card h2 {
    margin-bottom: .5rem;
    font-size: 1.2rem;
}

.error-card p {
    color: rgba(255, 255, 255, .4);
    font-size: .85rem;
}

/* Shared fade animation */
@keyframes fadeShift {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── QR CODE — BOTTOM RIGHT ───────────────────────────────── */
.brand-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    pointer-events: auto;
    opacity: 0;
    animation: fadeShift 1s ease forwards 1.5s;
}

.qr-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    font-family: 'Poppins', sans-serif;
}

.qr-mini-wrap {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform .3s ease;
}

.qr-mini-wrap:hover {
    transform: scale(1.05);
}

.qr-mini-wrap canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* ── MOBILE READABILITY ────────────────────────────────────── */
@media (max-width: 800px) {
    .logo-corner {
        top: 1rem;
        right: 1.2rem;
    }

    .logo-corner img {
        height: 24px;
    }

    .logo-corner span {
        font-size: 0.85rem;
    }

    .counter {
        top: 1.1rem;
        left: 1.2rem;
        font-size: 1.05rem;
    }

    .brand {
        padding: 2rem 1.5rem;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        text-align: left;
        gap: 0.8rem;
        background: linear-gradient(transparent, rgba(7, 17, 30, 0.96) 40%);
    }

    .brand-album {
        align-items: flex-start;
        gap: 0.3rem;
        max-width: 60%;
    }

    .brand-label {
        font-size: 0.85rem;
        letter-spacing: 0.15rem;
    }

    .brand-title {
        font-size: 1.6rem;
    }

    .brand-qr {
        align-items: flex-end;
        gap: 0.6rem;
    }

    .qr-text {
        font-size: 0.85rem;
    }

    .qr-mini-wrap {
        width: 120px;
        height: 120px;
        padding: 6px;
        border-radius: 10px;
    }

    .photo-stage {
        padding-bottom: 165px;
    }

    .photo-slot img,
    .photo-slot video {
        max-height: calc(100vh - 185px);
    }

    .new-badge {
        top: 3.5rem;
        font-size: 0.8rem;
        padding: 0.3rem 0.9rem;
    }

    .loader img {
        height: 32px;
    }

    .loader-text {
        font-size: 1rem;
    }
}

/* ── LIVE MESSAGES (WhatsApp-like) ─────────────────────────── */
#live-messages-container {
    position: fixed;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
    max-height: 80vh;
    /* Removed overflow: hidden so shadows aren't clipped */
}

.live-message {
    background: rgba(40, 50, 70, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    border-bottom-left-radius: 4px;
    padding: 24px 32px;
    color: #fff;
    max-width: 550px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: messageEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: bottom left;
    display: flex;
    flex-direction: column;
    position: relative;
}

.live-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 20px;
    height: 20px;
    background: rgba(40, 50, 70, 0.85);
    border-bottom-right-radius: 20px;
    mask-image: radial-gradient(circle at top left, transparent 20px, black 21px);
    -webkit-mask-image: radial-gradient(circle at top left, transparent 20px, black 21px);
}

.live-message.leaving {
    animation: messageLeave 0.6s ease forwards;
}

.live-message-sender {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-message-text {
    font-size: 2rem;
    font-family: var(--font-sans);
    line-height: 1.3;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
}

/* Emoji Explosion Animation */
.emoji-party {
    position: absolute;
    pointer-events: none;
    font-size: 3rem;
    /* Slightly smaller for a denser explosion */
    z-index: 100;
    animation-fill-mode: forwards;
    transform-origin: center;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    10% {
        opacity: 1;
        transform: translate(var(--tx-mid), var(--ty-mid)) scale(1.2) rotate(var(--rot-mid));
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx-end), var(--ty-end)) scale(0.8) rotate(var(--rot-end));
    }
}

@keyframes messageEnter {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }

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

@keyframes messageLeave {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
        filter: blur(4px);
    }
}

@media (max-width: 1024px) {
    .live-message-text {
        font-size: 1.5rem;
    }

    .live-message {
        max-width: 450px;
    }
}

@media (max-width: 800px) {
    #live-messages-container {
        top: auto;
        bottom: 90px;
        left: 20px;
        right: 20px;
        transform: none;
        align-items: flex-start;
    }

    .live-message {
        max-width: 100%;
        padding: 16px 20px;
        border-radius: 18px;
        border-bottom-left-radius: 4px;
    }

    .live-message-text {
        font-size: 1.2rem;
    }

    .live-message-sender {
        font-size: 0.95rem;
    }
}