body {
    margin: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 100%, #2a1a1a 0%, #1a0a0a 60%, #0a0505 100%);
    font-family: 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    height: 100vh;
}

.container {
    position: absolute;
    bottom: -900px; /* Start further down to hide completely */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: bottom 1s ease-out; /* Smooth stop without overshoot */
}

.maskot {
    width: 800px;
    max-width: 95vw;
    user-select: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: -20px; /* Keeps bottom of image at screen edge */
    margin-top: -100px; /* Crop 100px from top */
    clip-path: inset(100px 0 0 0); /* Hide top 100px */
}

.maskot:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 20px rgba(200, 50, 50, 0.5));
}

.maskot:active {
    transform: scale(0.95);
}

.bubble-wrapper {
    position: relative;
    margin-bottom: -80px;
}

.bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    padding: 20px 30px;
    border-radius: 20px;
    border: 2px solid #c83232;
    color: #1a0a0a;
    font-size: 1.2em;
    font-weight: 700;
    box-shadow: 0 5px 25px rgba(200, 50, 50, 0.3);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    max-width: 80vw;
    text-align: center;
}

/* Speech bubble tail */
.bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 12px 12px 0;
    border-style: solid;
    border-color: #c83232 transparent transparent transparent;
}

.bubble::before {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
    z-index: 1;
}

.bubble.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Chat input */
.chat-input-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.chat-input-wrapper.visible {
    opacity: 1;
}

#userInput {
    padding: 15px 25px;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 1em;
    font-family: 'Nunito', sans-serif;
    width: 300px;
    max-width: 50vw;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    outline: none;
    background: #1a0a0a;
    color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#userInput::placeholder {
    color: #888;
}

#userInput:focus {
    border-color: #c83232;
    box-shadow: 0 5px 25px rgba(200, 50, 50, 0.4);
}

#sendBtn {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #c83232 0%, #8b1a1a 100%);
    color: white;
    font-size: 1em;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(200, 50, 50, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sendBtn:hover {
    transform: scale(1.05);
}

#sendBtn:active {
    transform: scale(0.95);
}

#sendBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bubble.thinking::after {
    animation: pulse 1s infinite;
}

/* Thinking animation with bouncing dots */
.bubble.thinking {
    animation: bubblePulse 2s ease-in-out infinite;
}

.thinking-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: #c83232;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bubblePulse {
    0%, 100% { 
        box-shadow: 0 5px 25px rgba(200, 50, 50, 0.3);
    }
    50% { 
        box-shadow: 0 5px 35px rgba(200, 50, 50, 0.6);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Talking animation for maskot - controlled by JS */
.maskot.talking {
    transition: transform 0.08s ease-out;
}

/* Volume control */
.volume-control {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 10, 10, 0.8);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.volume-control.visible {
    opacity: 1;
}

.volume-icon {
    font-size: 1.2em;
    cursor: pointer;
}

#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #c83232 0%, #8b1a1a 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#volumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #c83232 0%, #8b1a1a 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}