* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#character-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 182, 193, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(173, 216, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 218, 185, 0.3) 0%, transparent 40%),
        linear-gradient(180deg, #e0f0ff 0%, #f5e6ff 40%, #fff5e6 70%, #e0ffe0 100%);
}

#speech-bubble {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.92);
    color: #222;
    padding: 14px 28px;
    border-radius: 22px;
    font-size: 18px;
    max-width: 70vw;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

#speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid rgba(255,255,255,0.92);
}

#speech-bubble.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

#character-canvas {
    max-width: 100%;
    max-height: 100%;
}

#ui-overlay {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

#status-indicator {
    color: #333;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
    padding: 10px 20px;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

#mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #ff8fa0;
    background: rgba(255,255,255,0.6);
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#mic-btn:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.05);
}

#mic-btn:active, #mic-btn.listening {
    background: rgba(255,100,120,0.6);
    border-color: #ff5577;
    color: #fff;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-screen p {
    color: #fff;
    margin-top: 20px;
    font-size: 16px;
}