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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a14 0%, #1a1a2e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    font-weight: 300;
}

main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInLeft 0.8s ease-out;
}

.input-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #4ecdc4;
}

.input-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.file-input-label {
    flex: 1;
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.file-input-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.file-input-label input {
    display: none;
}

.mic-button {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.mic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.mic-button.active {
    background: linear-gradient(135deg, #ff4458 0%, #ff1744 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 23, 68, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4);
    }
}

.audio-controls {
    margin-bottom: 30px;
}

audio {
    width: 100%;
    margin-bottom: 15px;
    display: none;
}

.playback-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.emotion-display h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #4ecdc4;
}

.emotion-meters {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.emotion-meter {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.emotion-label {
    font-size: 0.9rem;
    text-align: right;
}

.meter-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.meter-fill.joy {
    background: linear-gradient(90deg, #f9ca24, #f0932b);
}

.meter-fill.sadness {
    background: linear-gradient(90deg, #4834d4, #686de0);
}

.meter-fill.anger {
    background: linear-gradient(90deg, #eb4d4b, #ee5a24);
}

.meter-fill.calm {
    background: linear-gradient(90deg, #22a6b3, #7ed6df);
}

.meter-fill.energy {
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
}

.meter-value {
    font-size: 0.9rem;
    color: #888;
}

.visualization-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInRight 0.8s ease-out;
}

#visualizer {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    background: radial-gradient(ellipse at center, rgba(46, 49, 76, 0.3) 0%, rgba(10, 10, 20, 0.8) 100%);
    margin-bottom: 20px;
}

.viz-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.viz-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-size: 0.9rem;
}

.viz-controls select {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.viz-controls select option {
    background: #1a1a2e;
}

.viz-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

footer {
    text-align: center;
    margin-top: 60px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    animation: fadeInUp 0.8s ease-out;
}

/* アニメーション */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* レスポンシブデザイン */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        padding: 20px;
    }
    
    #visualizer {
        height: 400px;
    }
    
    .viz-controls {
        flex-direction: column;
        gap: 10px;
    }
}