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

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-family: 'Deltarune', 'Press Start 2P', monospace;
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.delta {
    color: #ff6b9d;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.8);
}

.rune {
    color: #4ecdc4;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
}

.subtitle {
    display: block;
    font-size: 0.4em;
    color: #ffd93d;
    margin-top: 0.5rem;
    text-shadow: 0 0 15px rgba(255, 217, 61, 0.6);
}

.description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.creator-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4ecdc4;
}

input, textarea {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

select option {
    background: #1a1a2e;
    color: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.5);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.generate-button {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.3);
}

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

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

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

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

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

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

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

.output-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.character-card {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    opacity: 0.6;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.character-display {
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

.character-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.character-name {
    font-family: 'Deltarune', 'Press Start 2P', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffd93d;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
}

.character-bio {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid #4ecdc4;
    text-align: left;
    line-height: 1.8;
}

.bio-paragraph {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.bio-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(78, 205, 196, 0.5), transparent);
    margin: 1.5rem 0;
}

.section-header {
    font-family: 'Deltarune', 'Press Start 2P', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem 0;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.battle-header {
    background: linear-gradient(45deg, rgba(255, 71, 87, 0.3), rgba(255, 55, 66, 0.3));
    border: 1px solid rgba(255, 71, 87, 0.5);
    color: #ff4757;
}

.personality-header {
    background: linear-gradient(45deg, rgba(116, 185, 255, 0.3), rgba(9, 132, 227, 0.3));
    border: 1px solid rgba(116, 185, 255, 0.5);
    color: #74b9ff;
}

.appearance-header {
    background: linear-gradient(45deg, rgba(255, 217, 61, 0.3), rgba(253, 203, 110, 0.3));
    border: 1px solid rgba(255, 217, 61, 0.5);
    color: #ffd93d;
}

.origin-header {
    background: linear-gradient(45deg, rgba(255, 107, 157, 0.3), rgba(253, 121, 168, 0.3));
    border: 1px solid rgba(255, 107, 157, 0.5);
    color: #ff6b9d;
}

.role-header {
    background: linear-gradient(45deg, rgba(78, 205, 196, 0.3), rgba(68, 160, 141, 0.3));
    border: 1px solid rgba(78, 205, 196, 0.5);
    color: #4ecdc4;
}

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

.examples {
    text-align: center;
}

.examples h3 {
    margin-bottom: 2rem;
    font-size: 1.3rem;
    color: #4ecdc4;
}

.example-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.example-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.2);
}

.example-card strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #ff6b9d;
    font-size: 1.1rem;
    font-family: 'Deltarune', 'Press Start 2P', monospace;
}

.example-card p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.audio-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.audio-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.audio-btn.muted {
    opacity: 0.5;
    background: rgba(255, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .creator-panel {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.6rem;
    }
}