body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    font-family: 'Varela Round', sans-serif;
}

#phone-container {
    width: 380px;
    height: 820px;
    background-color: #ffffff;
    border-radius: 45px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), inset 0 0 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 4px solid #eaeaea;
}

.speaker {
    position: absolute;
    top: 20px;
    width: 60px;
    height: 6px;
    background-color: #ccc;
    border-radius: 10px;
    z-index: 100;
}

.camera {
    position: absolute;
    top: 15px;
    right: 120px;
    width: 15px;
    height: 15px;
    background-color: #333;
    border-radius: 50%;
    border: 2px solid #555;
    z-index: 100;
}

.home-btn {
    position: absolute;
    bottom: 15px;
    width: 50px;
    height: 50px;
    border: 3px solid #ddd;
    border-radius: 50%;
    z-index: 100;
    background: #f9f9f9;
}

#screen {
    width: 350px;
    height: 720px;
    background: #fdfbfb;
    border-radius: 35px;
    overflow: hidden;
    position: relative;
    margin-top: 40px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* Splash Screen */
#splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.splash-logo {
    font-size: 100px;
    animation: bounce 2s infinite ease-in-out;
    margin-bottom: 20px;
}

#splash-screen h1 {
    font-size: 38px;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

#splash-screen p {
    font-size: 16px;
    margin-bottom: 40px;
    opacity: 0.9;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    font-family: 'Varela Round', sans-serif;
    background: white;
    color: #ff6b81;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 107, 129, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 25px rgba(255, 107, 129, 0.4);
}

button:active {
    transform: translateY(2px);
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transform: scaleX(-1);
    opacity: 0.6; /* Lighten the video to keep the cheerful vibe */
}

#ui {
    position: absolute;
    top: 35px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 10;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    text-align: center;
}

#ui div {
    background: rgba(255, 107, 129, 0.85);
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid white;
}

#expression-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 30px;
    border-radius: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 25px;
    border: 2px solid #f0f0f0;
}

#expression-icon {
    font-size: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#expression-icon img.emoji {
    width: 35px !important;
    height: 35px !important;
    margin: 0 !important;
    vertical-align: middle !important;
    display: block;
}

#expression-text {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b81;
    line-height: 1;
    display: inline-block;
}

#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #a1c4fd 0%, #c2e9fb 100%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #4a4a4a;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

.falling-emoji {
    position: absolute;
    font-size: 60px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
    transition: top 0.05s linear;
}

img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

.pop-anim {
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6) rotate(15deg); opacity: 0.9; }
    100% { transform: scale(2.2) rotate(30deg); opacity: 0; }
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 80;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
}

#game-over h1 {
    font-size: 45px;
    color: #ff4757;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

/* Particles */
#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 7;
}

.particle {
    position: absolute;
    animation: flyout 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    transform-origin: center;
}

.particle-circle {
    border-radius: 50%;
}

.particle-confetti {
    border-radius: 0;
}

.particle-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    background-color: #ffd700 !important;
}

.particle-sparkle {
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
    background-color: #ffffff !important;
}

.particle-rainbow {
    background: linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) !important;
    background-size: 200% 200%;
    animation: flyout 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards, rainbowBg 1s linear infinite;
    border-radius: 50%;
}

@keyframes rainbowBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes flyout {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}

@keyframes shake {
    10%, 90% { transform: translate3d(calc(-1 * var(--shake)), 0, 0); }
    20%, 80% { transform: translate3d(var(--shake), 0, 0); }
    30%, 50%, 70% { transform: translate3d(calc(-1 * var(--shake)), 0, 0); }
    40%, 60% { transform: translate3d(var(--shake), 0, 0); }
}

/* Mobile Responsiveness */
@media (max-width: 600px), (max-height: 850px) {
    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    #phone-container {
        width: 100vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    
    .speaker, .camera, .home-btn {
        display: none;
    }
    
    #screen {
        width: 100%;
        height: 100%;
        margin-top: 0;
        border-radius: 0;
    }
    
    #video {
        width: 100%;
        height: 100%;
    }
}
