@font-face {
    font-family: 'Deltarune';
    src: url('/undertale-deltarune-text-font-extended.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Deltarune', 'Space Mono', monospace;
    background: #1a1a2e;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/Backdrop.gif');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    color: #b8b8b8;
}

.mixing-area {
    background: rgba(30, 30, 60, 0.8);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.3s both;
}

.input-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.element-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    color: white;
    font-family: 'Deltarune', 'Space Mono', monospace;
    width: 200px;
    transition: all 0.3s ease;
}

.element-input:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.element-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.plus {
    font-size: 2rem;
    font-weight: bold;
    color: #4ecdc4;
    animation: pulse 2s infinite;
}

.mix-button {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    border-radius: 15px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    font-family: 'Deltarune', 'Space Mono', monospace;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 180px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mix-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.mix-button:active {
    transform: translateY(0);
}

.mix-button.loading {
    pointer-events: none;
}

.button-text {
    transition: opacity 0.3s ease;
}

.loading-spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mix-button.loading .button-text {
    opacity: 0;
}

.mix-button.loading .loading-spinner {
    opacity: 1;
}

.result-area {
    display: flex;
    justify-content: center;
}

.result-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 400px;
    width: 100%;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease-out;
}

.result-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #4ecdc4;
}

.result-description {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

.history-section {
    background: rgba(30, 30, 60, 0.6);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.history-section h3 {
    margin-bottom: 1rem;
    color: #4ecdc4;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid #4ecdc4;
    animation: slideInLeft 0.5s ease-out;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.history-formula {
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 0.2rem;
}

.history-result {
    color: #4ecdc4;
    font-size: 0.9rem;
}

.music-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-button {
    background: rgba(30, 30, 60, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.music-button:hover {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
    transform: scale(1.1);
}

.music-button.playing {
    background: rgba(78, 205, 196, 0.5);
    border-color: #4ecdc4;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .element-input {
        width: 100%;
        max-width: 300px;
    }
    
    .plus {
        transform: rotate(90deg);
    }
    
    .mixing-area {
        padding: 1.5rem;
    }
}

