:root {
    --envelope-scale: 1;
    --nav-item-size: 80px;
    --top-nav-top: 20px;
    --circle-scale: 1;
}

@media (max-width: 480px) {
    :root {
        --envelope-scale: 0.85;
        --nav-item-size: 60px;
        --top-nav-top: 10px;
        --circle-scale: 0.85;
    }
}

@media (max-width: 360px) {
    :root {
        --envelope-scale: 0.72;
        --nav-item-size: 50px;
        --top-nav-top: 8px;
        --circle-scale: 0.75;
    }
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0c1a;
    /* Even deeper midnight blue */
}

.space-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Sliding Top Navigation Menu */
.top-nav {
    position: absolute;
    top: var(--top-nav-top, 20px);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    overflow-x: auto;
    z-index: 50;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Hide scrollbar for a cleaner look */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.top-nav::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.nav-track {
    display: flex;
    padding: 10px 15px;
    gap: 15px;
    /* Ensures the track can be wider than the container */
    min-width: max-content;
}

.nav-item {
    display: block;
    width: var(--nav-item-size, 80px);
    height: var(--nav-item-size, 80px);
    border-radius: 12px;
    /* Rounded squares */
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 2px solid transparent;
    cursor: pointer;
}

.nav-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    transform: translateY(-5px) scale(1.05);
}

.nav-item:hover img {
    transform: scale(1.1);
}

/* Base styles for the soft, drifting clouds */
.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.65;
    animation: drift 25s infinite alternate ease-in-out;
}

/* Deep Sapphire */
.sapphire-glow {
    width: 70vw;
    height: 70vh;
    top: -15%;
    left: -10%;
    background: radial-gradient(circle, rgba(15, 82, 186, 0.9) 0%, rgba(15, 82, 186, 0) 70%);
}

/* Rose Quartz */
.rose-quartz-glow {
    width: 60vw;
    height: 60vh;
    bottom: -10%;
    right: -5%;
    background: radial-gradient(circle, rgba(247, 202, 201, 0.8) 0%, rgba(247, 202, 201, 0) 70%);
    animation-delay: -8s;
}

/* Soft Gold Depth */
.soft-gold-glow {
    width: 45vw;
    height: 45vh;
    top: 25%;
    left: 25%;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.4) 0%, rgba(218, 165, 32, 0) 70%);
    animation-delay: -15s;
}

#starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    mix-blend-mode: screen;
}

/* Center and animate your image container */
.mailbox-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    /* Ensures it stays above clouds and stars */
    width: min(85vw, 350px);
    aspect-ratio: 1714 / 4096;
    /* Adjust to fit perfectly */
    opacity: 0;
    transition: opacity 1.4s ease;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.mailbox-container.is-visible {
    opacity: 1;
}

.mailbox-base {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.mailbox-screen-container {
    position: absolute;
    left: 28.2%;
    top: 43.45%;
    width: 43.24%;
    height: 20.73%;
    overflow: hidden;
    border-radius: 2.2%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 94, 126, 0.25) 0%, rgba(11, 12, 26, 0.9) 100%);
    border: 1px solid rgba(255, 130, 160, 0.4);
    box-shadow: 0 0 15px rgba(255, 94, 126, 0.55), inset 0 0 10px rgba(255, 94, 126, 0.35);
}

.mailbox-screen {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    z-index: 2;
}

/* Cloud drifting animation */
@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, -30px) scale(1.15);
    }
}

/* Hovering animation for the mailbox */
@keyframes float {
    0% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, -53%);
    }

    /* Moves slightly up */
    100% {
        transform: translate(-50%, -50%);
    }
}

/* Play button */
.play-btn {
    position: relative;
    overflow: hidden;
    padding: 12px 24px;
    font-size: 16px;
    font-family: sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #ff9ebb 0%, #ff5e7e 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(255, 94, 126, 0.4), 0 0 8px rgba(255, 94, 126, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    letter-spacing: 1px;
    animation: btnGlow 2.5s infinite ease-in-out;
}

/* Shimmer shine sweep effect */
.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.65) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    pointer-events: none;
    animation: btnShimmer 3.5s infinite ease-in-out;
}

.play-btn:hover {
    background: linear-gradient(135deg, #ffaec6 0%, #ff6e8c 100%);
    box-shadow: 0 4px 22px rgba(255, 94, 126, 0.7), 0 0 16px rgba(255, 94, 126, 0.4);
}

.bottom-overlay .play-btn:hover {
    transform: translateX(-50%) scale(calc(var(--circle-scale) * 1.05));
}

@keyframes btnShimmer {
    0% {
        left: -150%;
    }

    30% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes btnGlow {
    0% {
        box-shadow: 0 4px 15px rgba(255, 94, 126, 0.4), 0 0 8px rgba(255, 94, 126, 0.2);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 94, 126, 0.65), 0 0 18px rgba(255, 94, 126, 0.5);
    }

    100% {
        box-shadow: 0 4px 15px rgba(255, 94, 126, 0.4), 0 0 8px rgba(255, 94, 126, 0.2);
    }
}

/* Bottom overlay: star circle + button (topmost layer) */
.bottom-overlay {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    --circle-size: calc(240px * var(--circle-scale));
    --circle-half: calc(120px * var(--circle-scale));
    width: var(--circle-size);
    height: calc(var(--circle-half) + 130px);
    z-index: 300;
    pointer-events: none;
}

.bottom-overlay>* {
    pointer-events: auto;
}

.star-circle {
    width: var(--circle-size);
    height: var(--circle-half);
    border-radius: 9999px 9999px 0 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    z-index: 1;
}

#starCircle {
    position: absolute;
    left: 0;
    bottom: calc(var(--circle-half) * -1);
    width: var(--circle-size);
    height: var(--circle-size);
    display: block;
}

.bottom-overlay .play-btn {
    position: absolute;
    left: 50%;
    bottom: calc(var(--circle-half) - calc(75px * var(--circle-scale)));
    transform: translateX(-50%) scale(var(--circle-scale));
    z-index: 2;
}

/* Animated CSS Envelope Container */
.css-envelope-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(var(--envelope-scale));
    width: 300px;
    height: 200px;
    z-index: 120;
    perspective: 1000px;
    opacity: 0;
    animation: envelopeAppear 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes envelopeAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(calc(var(--envelope-scale) * 0.75));
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(var(--envelope-scale));
    }
}

/* Envelope base */
.css-envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffccd5;
    /* Cute pastel pink back */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}

/* The letter paper */
.envelope-paper {
    position: absolute;
    width: 280px;
    height: 180px;
    left: 10px;
    bottom: 10px;
    background: transparent;
    /* Changed from white to let user image fill */
    z-index: 2;
    /* Between back and front */
    transform: translateY(0);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.envelope-paper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text overlaid on the letter paper */
.paper-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 5vw, 20px);
    font-weight: 700;
    color: #cc4e6c;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
    line-height: 1.4;
}

/* The side flaps of the envelope */
.envelope-left-right {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 100px solid transparent;
    border-bottom: 100px solid transparent;
    border-left: 150px solid #ffb3c1;
    border-right: 150px solid #ffb3c1;
    z-index: 3;
    pointer-events: none;
}

/* The bottom flap of the envelope */
.envelope-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-bottom: 120px solid #ffa6b9;
    z-index: 3;
    pointer-events: none;
}

/* The top flap of the envelope */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 120px solid #ff99af;
    transform-origin: top;
    z-index: 4;
    /* Covers paper and lower flaps initially */
    transition: transform 0.6s ease, z-index 0s 0.3s;
    /* z-index changes midway! */
}

/* Cute heart seal */
.envelope-flap::after {
    content: '❤';
    position: absolute;
    top: -38px;
    left: -14px;
    font-size: 28px;
    color: #ff3b6b;
    transition: opacity 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Open states */
.css-envelope-container.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
    /* Drops behind paper */
}

.css-envelope-container.open .envelope-flap::after {
    opacity: 0;
    /* Hide the seal when opening */
}

.css-envelope-container.open .envelope-paper {
    animation: paperUpThenCenter 1.4s cubic-bezier(0.25, 1, 0.5, 1) 0.55s forwards;
}

.css-envelope-container.paper-front .envelope-paper {
    z-index: 6;
}

@keyframes paperUpThenCenter {
    0% {
        transform: translateY(0);
    }

    65% {
        transform: translateY(-165px);
    }

    100% {
        transform: translateY(-95px);
    }
}

/* Dispensing Envelope (Pink Vending Machine style) */
.dispensing-envelope {
    position: absolute;
    left: 50%;
    top: 45%;
    /* Start from the center/mailbox slot area */
    width: calc(150px * var(--envelope-scale));
    aspect-ratio: 1.42 / 1;
    transform-origin: center center;
    z-index: 25;
    background: linear-gradient(180deg, #fffdfd 0%, #ffe9f4 100%);
    border: 4px solid #ffd0e8;
    border-radius: 7px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: envelopeOut 2.4s linear forwards;
    /* Sped up by 0.2s */
    will-change: transform, opacity;
    backface-visibility: hidden;
    contain: layout paint style;
    pointer-events: none;
}

.dispensing-envelope::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, transparent 49%, #ffd4ea 50% 53%, transparent 54%),
        linear-gradient(35deg, transparent 49%, #ffd4ea 50% 53%, transparent 54%);
    opacity: 0.95;
}

.dispensing-envelope::after {
    content: "❤";
    position: absolute;
    left: 50%;
    top: 53%;
    transform: translate(-50%, -50%);
    color: #f49ac3;
    font-size: 24px;
}

@keyframes envelopeOut {
    0% {
        opacity: 0;
        transform: translate3d(-50%, -110px, 0) scaleX(0.92) scaleY(0.18);
    }

    10% {
        opacity: 1;
        transform: translate3d(-50%, -60px, 0) scaleX(0.96) scaleY(0.35);
    }

    20% {
        opacity: 1;
        transform: translate3d(-50%, 0px, 0) scaleX(1.02) scaleY(0.68);
    }

    32% {
        opacity: 1;
        transform: translate3d(-50%, 82px, 0) scaleX(0.97) scaleY(1.06);
    }

    45% {
        opacity: 1;
        transform: translate3d(-50%, 178px, 0) scaleX(1.01) scaleY(0.99);
    }

    60% {
        opacity: 1;
        transform: translate3d(-50%, 288px, 0) scaleX(1) scaleY(1.01);
    }

    78% {
        opacity: 1;
        transform: translate3d(-50%, 420px, 0) scaleX(1) scaleY(1);
    }

    100% {
        opacity: 0;
        transform: translate3d(-50%, 75vh, 0) scaleX(1) scaleY(1);
    }
}

/* ==========================================================================
   Advanced Control Elements & Skip Button
   ========================================================================== */

/* Skip Button (Bottom Right of Top Menu List) */
.skip-btn {
    position: absolute;
    top: calc(var(--top-nav-top, 20px) + var(--nav-item-size, 80px) + 20px);
    right: calc(50% - min(45vw, 250px));
    /* aligned with the right edge of top-nav container */
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Sub-buttons surrounding Play (Warehouse & Search) */
.sub-btn {
    position: absolute;
    width: calc(44px * var(--circle-scale));
    height: calc(44px * var(--circle-scale));
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.sub-btn svg {
    transition: transform 0.3s ease;
}

.sub-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.sub-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.sub-btn-left {
    left: calc(12px * var(--circle-scale));
    bottom: calc(32px * var(--circle-scale));
}

.sub-btn-right {
    right: calc(12px * var(--circle-scale));
    bottom: calc(32px * var(--circle-scale));
}

/* Active Button Animation States */
.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 90px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.play-btn.loading-state {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    pointer-events: none;
    animation: none !important;
    box-shadow: none !important;
}

.play-btn.loading-state::before {
    animation: none !important;
}

.play-btn.back-state {
    background: linear-gradient(135deg, #ff5e7e 0%, #ff4066 100%);
    border-color: #ff859d;
    box-shadow: 0 4px 15px rgba(255, 94, 126, 0.4);
    animation: btnGlow 2.5s infinite ease-in-out !important;
}

.play-btn.back-state::before {
    animation: btnShimmer 3.5s infinite ease-in-out !important;
}

.play-btn.back-state:hover {
    background: linear-gradient(135deg, #ffaec6 0%, #ff6e8c 100%);
    box-shadow: 0 4px 22px rgba(255, 94, 126, 0.7), 0 0 16px rgba(255, 94, 126, 0.4);
}

/* Loading Spinner inside Button */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
    display: inline-block;
}

@keyframes btnSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   Modals & Glassmorphic Draw History List
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 9, 21, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: rgba(255, 240, 246, 0.96);
    border: 2px solid #ffd0e8;
    border-radius: 24px;
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #4a384f;
    overflow: hidden;
}

.modal-overlay.open .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 185, 215, 0.3);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #d06698;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #a58e9f;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    padding: 0;
    margin-top: -4px;
}

.modal-close:hover {
    color: #ff527b;
    transform: scale(1.15) rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Records Draw List */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 185, 215, 0.25);
    border-radius: 12px;
    transition: transform 0.2s, background 0.2s;
}

.record-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(255, 185, 215, 0.15);
}

.record-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ffd0e8;
    background: #fff;
    flex-shrink: 0;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.record-title {
    font-size: 14px;
    font-weight: 600;
    color: #b84f7f;
}

.record-time {
    font-size: 11px;
    color: #9f8c9b;
}

.no-records {
    text-align: center;
    color: #9f8c9b;
    padding: 40px 10px;
    font-size: 14px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 185, 215, 0.3);
    background: rgba(255, 255, 255, 0.3);
}

.clear-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #ff5e7e 0%, #ff4066 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 94, 126, 0.3);
    transition: all 0.3s;
}

.clear-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(255, 94, 126, 0.45);
}

/* Detail Zoom Modal */
.detail-card {
    max-width: 340px;
}

.detail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
}

.zoom-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 4px solid #ffd0e8;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.zoom-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-paper-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 6vw, 26px);
    font-weight: 700;
    color: #cc4e6c;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    padding: 25px;
    box-sizing: border-box;
    z-index: 10;
    line-height: 1.5;
}

.draw-time-text {
    font-size: 12px;
    color: #9f8c9b;
    margin: 0;
    text-align: center;
}

/* Toast Message */
.custom-toast {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(255, 94, 126, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(255, 94, 126, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    text-align: center;
    white-space: nowrap;
}

.custom-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Instant skip state to bypass animations */
.css-envelope-container.instant {
    animation: none !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(var(--envelope-scale)) !important;
}

.css-envelope-container.instant .envelope-paper {
    animation: none !important;
    transform: translateY(-95px) !important;
}

.css-envelope-container.instant .envelope-flap {
    transition: none !important;
    transform: rotateX(180deg) !important;
    z-index: 1 !important;
}

.css-envelope-container.instant .envelope-flap::after {
    opacity: 0 !important;
}