html {
    font-size: 14px;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'M PLUS Rounded 1C', sans-serif;
}

#slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slide-pane {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide-pane.active { opacity: 1; }

.slide-fg-image {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.4));
    opacity: 0;
    transform: scale(1);
    z-index: 10;
}

#particle-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.particle { position: absolute; opacity: 0; font-size: 16px; text-shadow: 0 0 5px rgba(255,255,255,0.5); z-index: 15; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.8); } to { transform: scale(1); opacity: 1; } }
@keyframes zoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.2); } }
@keyframes blurIn { from { filter: drop-shadow(0 0 15px rgba(0,0,0,0.4)) blur(20px); opacity: 0; } to { filter: drop-shadow(0 0 15px rgba(0,0,0,0.4)) blur(0); opacity: 1; } }
@keyframes blurOut { from { filter: drop-shadow(0 0 15px rgba(0,0,0,0.4)) blur(0); opacity: 1; } to { filter: drop-shadow(0 0 15px rgba(0,0,0,0.4)) blur(20px); opacity: 0; } }
@keyframes irisIn { from { clip-path: circle(0%); } to { clip-path: circle(100%); } }

/* Particle Animations */
@keyframes floatUp {
    from { transform: translateY(0) rotate(var(--r-start)); opacity: 0; }
    10% { opacity: 1; }
    to { transform: translateY(-110vh) rotate(var(--r-end)); opacity: 0; }
}
@keyframes pop { 
    0% { transform: scale(0); opacity: 0; } 
    50% { transform: scale(1.2); opacity: 1; } 
    100% { transform: scale(0); opacity: 0; } 
}
@keyframes pop-rotate { 
    0% { transform: scale(0) rotate(0deg); opacity: 0; } 
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; } 
    100% { transform: scale(0) rotate(360deg); opacity: 0; } 
}
@keyframes drift {
    from { transform: translateX(-10vw) translateY(var(--start-y, 50vh)) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    to { transform: translateX(110vw) translateY(var(--end-y, 50vh)) rotate(360deg); opacity: 0; }
}
@keyframes twinkle { 
    0%, 100% { opacity: 0; transform: scale(0.5); } 
    50% { opacity: 1; transform: scale(1); } 
}
@keyframes scale-and-float-up {
    from { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    to { transform: translateY(-100vh) scale(2); opacity: 0; }
}
@keyframes balloon-float {
    from {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) translateX(var(--x-drift)) rotate(var(--r-end));
        opacity: 0;
    }
}

.animate-fade-in { animation: fadeIn 1.5s ease-in-out forwards; }
.animate-fade-out { animation: fadeOut 1.5s ease-in-out forwards; }
.animate-zoom-in { animation: zoomIn 1.5s ease-in-out forwards; }
.animate-zoom-out { animation: zoomOut 1.5s ease-in-out forwards; }
.animate-blur-in { animation: blurIn 1.5s ease-in-out forwards; }
.animate-blur-out { animation: blurOut 1.5s ease-in-out forwards; }
.animate-iris-in { animation: irisIn 1.5s ease-in-out forwards; opacity: 1; }

/* --- Title Screen --- */
#title-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
    z-index: 1002;
}

#title-image { max-width: 80%; max-height: 70%; object-fit: contain; margin-bottom: 30px; }
#start-btn { font-size: 20px; padding: 15px 30px; background-color: #4CAF50; color: white; border: none; border-radius: 50px; cursor: pointer; transition: background-color 0.3s ease; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); font-weight: 700; }
#start-btn:hover { background-color: #45a049; }
.title-content { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #333; }

/* --- Unified UI Container --- */
#ui-container {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 1001;
    transition: opacity 0.5s ease-in-out;
}

#image-info {
    color: white;
    text-align: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    padding: 0 10px;
}

#image-info a { color: #87cefa; text-decoration: none; }
#image-info a:hover { text-decoration: underline; }

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

#controls, #audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#controls button, #audio-controls button {
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#controls button:hover, #audio-controls button:hover { background-color: white; }

#volume-slider { -webkit-appearance: none; appearance: none; width: 80px; height: 5px; background: rgba(255, 255, 255, 0.5); border-radius: 5px; outline: none; }
#volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; background: white; border-radius: 50%; cursor: pointer; }
#volume-slider::-moz-range-thumb { width: 15px; height: 15px; background: white; border-radius: 50%; cursor: pointer; }

/* --- Other UI --- */
#contact-link {
    position: fixed;
    bottom: 10px;
    right: 15px;
    z-index: 1002;
}
#contact-link a {
    color: #A9A9A9; /* Dark Gray */
    font-size: 14px;
    text-decoration: none;
}
#contact-link a:hover { color: white; }

#close-btn-container { position: fixed; top: 10px; right: 10px; z-index: 1003; }
#close-btn { background-color: rgba(0, 0, 0, 0.5); color: white; border: 1px solid white; border-radius: 50%; width: 40px; height: 40px; font-size: 24px; cursor: pointer; display: flex; justify-content: center; align-items: center; line-height: 1; }
#close-btn:hover { background-color: rgba(0, 0, 0, 0.7); }

#whiteout {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: white;
    opacity: 0;
    z-index: 1010;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.hidden { display: none !important; }

.balloon-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1005;
}

@keyframes balloon-float {
    from {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    to {
        transform: translateY(-110vh) translateX(var(--x-drift)) rotate(var(--r-end));
        opacity: 0;
    }
}


@media (max-width: 768px) {
    .slide-fg-image { height: 75%; top: 5%; }
    #ui-container { width: calc(100% - 20px); bottom: 10px; }
}

@media (max-width: 480px) {
    .slide-fg-image { height: 70%; top: 5%; }
    #ui-container { flex-direction: column; }
    .controls-row { flex-direction: column; gap: 10px; }
}
