body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Playfair Display', Georgia, serif;
    background: linear-gradient(180deg, #050406, #0b0610 60%);
    color: #fff;
}

.page-header {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 12;
    pointer-events: none;
}

.page-title {
    display: inline-block;
    background: linear-gradient(90deg, rgba(255,240,245,0.06), rgba(255,250,230,0.02));
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: clamp(1rem, 2.4vw, 1.6rem);
    box-shadow: 0 6px 30px rgba(0,0,0,0.5), 0 0 18px rgba(255,215,0,0.08) inset;
    border: 1px solid rgba(255,255,255,0.05);
    pointer-events: none;
}

.title-main {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #fff7ee;
    font-size: 0.9em;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.title-names {
    display: block;
    font-family: 'Great Vibes', cursive;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    color: #ffd976;
    -webkit-text-stroke: 1px rgba(0,0,0,0.25);
    text-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 10px rgba(255,215,0,0.5);
}

.header-decor {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -6px;
    opacity: 0.95;
}

/* Mobile first adjustments */
@media (max-width: 600px) {
    .page-title { padding: 0.2rem 0.6rem; }
    .title-main { font-size: 0.85rem; letter-spacing: 0.6px; }
    .title-names { font-size: clamp(1.6rem, 9vw, 2.6rem); }
    .header-decor { width: 160px; top: -8px; }
    .phrase-container { bottom: 8%; width: 94%; padding: 0.75rem 1rem; }
    .phrase-container .phrase-text { font-size: clamp(1.1rem, 4vw, 1.6rem); }
    .phrase-container .phrase-signature { font-size: 1rem; }
    /* reduce confetti z-index on small screens to avoid heavy painting */
    #confetti { opacity: 0.9; }
}

@media (min-width: 601px) {
    /* desktop tweaks */
    .title-names { font-size: clamp(2.4rem, 6vw, 4.2rem); }
}

.slideshow-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.slide img,
.slide video {
    width: 100%;
    height: 100%;
    /* ensure very tall or very wide images fit without cropping */
    object-fit: contain;
    /* align images to top center so tall images are visible from top */
    object-position: top center;
    filter: contrast(1.04) saturate(1.08) sepia(0.04) hue-rotate(-3deg) brightness(0.98);
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 4px 18px rgba(0,0,0,0.45) inset;
    transform-origin: 50% 50%;
    transition: transform 8s ease, filter 0.6s ease, opacity 0.6s ease;
}

.slide::before {
    /* golden soft frame */
    content: "";
    position: absolute;
    inset: 8px;
    pointer-events: none;
    border-radius: 12px;
    border: 2px solid rgba(255,215,0,0.08);
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 20px rgba(255,215,0,0.04) inset;
}

.slide::after {
    /* vignette + subtle sheen */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 10px;
    background-image: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.28) 100%),
                      linear-gradient(90deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.00) 100%);
    background-size: 200% 100%, 200% 100%;
    mix-blend-mode: multiply;
    animation: sheen 12s linear infinite;
    opacity: 0.95;
}

@keyframes slow-zoom {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes sheen {
    0% { background-position: -200% 0, -200% 0; }
    100% { background-position: 200% 0, 200% 0; }
}

.slide:hover img,
.slide:hover video {
    transform: scale(1.06) rotate(-0.25deg);
    filter: contrast(1.08) saturate(1.12) brightness(1.02);
}

/* Thumbnails hover refinement */
.card img, .card video {
    transition: transform 0.4s ease, filter 0.4s ease;
}
.card:hover img, .card:hover video {
    transform: scale(1.05);
    filter: saturate(1.12) contrast(1.03);
}

.slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

.phrase-container {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 90%;
    text-align: center;
    padding: 1rem 2rem;
    color: white;
    background-color: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25));
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 5;
}

.phrase-container .phrase-text {
    font-size: clamp(1.6rem, 4.2vw, 3rem);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #fff8f8;
    text-shadow: 0 4px 20px rgba(0,0,0,0.7), 0 0 12px rgba(255,230,180,0.06);
}

.phrase-container .phrase-signature {
    font-size: clamp(1.1rem, 2.6vw, 1.6rem);
    font-family: 'Great Vibes', 'Brush Script MT', cursive;
    font-style: normal;
    opacity: 0.95;
    margin-top: 10px;
    color: #ffe9d6;
    transform: translateY(2px);
}

.phrase-container.visible {
    opacity: 1;
}


.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.36); /* let slideshow be visible behind */
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20;
}

#announcement-overlay {
    z-index: 20;
}

.announcement-box {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    color: white;
    max-width: 90%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.announcement-box h2 {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    margin: 0;
}

.announcement-signature {
    margin-top: 0.6rem;
    color: #ffe9d6;
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    font-size: 1.1rem;
    opacity: 0.95;
}



.phase {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hourglass {
    font-size: clamp(8rem, 20vw, 12rem);
    animation: pulse 1s infinite;
}

#countdown {
    font-size: clamp(4rem, 10vw, 6rem);
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.slot-machine {
    font-size: clamp(6rem, 15vw, 10rem);
    color: white;
    overflow: hidden;
    height: clamp(8rem, 20vw, 12rem);
    border: 3px solid white;
    padding: 10px;
    background: #333;
}

.numbers {
    animation: slide 4s linear infinite;
}

@keyframes slide {
    from { transform: translateY(-50%); }
    to { transform: translateY(0); }
}

.winner-number {
    font-size: clamp(8rem, 25vw, 20rem);
    color: gold;
    animation: winner-pop 0.5s, gold-flash 1s infinite;
    text-shadow: 0 0 20px #fff, 0 0 30px #ff0, 0 0 40px #ff0;
}

@keyframes winner-pop {
    0% { transform: scale(0.1); }
    100% { transform: scale(1); }
}

@keyframes gold-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 215, 0, 0.3); }
}

#confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    pointer-events: none;
}

/* Fixed winner box (small, persistent on all clients) */
.fixed-winner {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 70;
    pointer-events: auto;
}
.fixed-winner-inner {
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), 0 0 10px rgba(255,215,0,0.06) inset;
    min-width: 80px;
}
.fixed-winner-label { font-size: 0.8rem; opacity: 0.9; margin-bottom: 4px; }
.fixed-winner-number { font-size: 1.6rem; font-weight: 700; color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.6); }

@media (max-width: 600px) {
    .fixed-winner { top: 8px; right: 8px; }
    .fixed-winner-number { font-size: 1.2rem; }
}

.overlay .phase .panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border-radius: 14px;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), 0 0 20px rgba(255,215,0,0.05) inset;
    border: 1px solid rgba(255,215,0,0.08);
    backdrop-filter: blur(6px) saturate(1.1);
}

.phase #countdown {
    font-size: clamp(3rem, 8vw, 5rem);
    color: #fff;
    text-shadow: 0 0 24px rgba(255,215,0,0.8);
}

.slot-machine {
    background: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.4));
    border-radius: 12px;
    padding: 0.6rem 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.winner-number {
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255,223,0,0.9), 0 0 60px rgba(255,160,0,0.6);
}

.overlay .announcement-box {
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

/* Wedding visual effects */
#effects-container {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 8;
}

.heart {
    position: absolute;
    bottom: -50px;
    width: 24px;
    height: 24px;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #ff6b9a 0%, #ffb3c6 100%);
    border-radius: 4px 4px 0 0;
    animation-name: riseAndFade;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.heart::before,
.heart::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background: inherit;
    border-radius: 50%;
}

.heart::before { top: -12px; left: 0; }
.heart::after { top: 0; left: 12px; }

@keyframes riseAndFade {
    0% { transform: translateY(0) rotate(-45deg) scale(0.8); opacity: 1; }
    50% { opacity: 0.9; }
    100% { transform: translateY(-120vh) rotate(-45deg) scale(1.2); opacity: 0; }
}

/* Soft wedding overlay */
.slideshow-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,240,245,0.06), rgba(0,0,0,0.25));
    pointer-events: none;
}
