* {
    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, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

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

header {
    text-align: center;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #00ff41, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(250, 112, 154, 0.4);
}

.btn-danger.recording {
    animation: pulse 1.5s infinite;
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
}

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

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(17, 153, 142, 0.4);
}

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

.icon {
    font-size: 1.2rem;
}

.settings {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.setting-group label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

select, input[type="range"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
}

select:focus, input[type="range"]:focus {
    border-color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

select option {
    background: #302b63;
}

input[type="range"] {
    width: 100px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 255, 65, 0.3);
}

.panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #00ff41;
    text-transform: uppercase;
    letter-spacing: 1px;
}

canvas {
    width: 100%;
    height: 200px;
    background: #1a1a2e;
    border-radius: 10px;
    margin-bottom: 10px;
}

.info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    font-size: 0.9rem;
}

.info span:last-child {
    font-weight: bold;
    color: #00ff41;
    font-family: 'Courier New', monospace;
}

.audio-player {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

audio {
    flex: 1;
    height: 40px;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 50px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .input-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .settings {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-group {
        justify-content: space-between;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        margin-bottom: 15px;
    }

    canvas {
        height: 150px;
    }

    .audio-player {
        flex-direction: column;
    }

    audio {
        width: 100%;
    }
}

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

.panel {
    animation: fadeIn 0.5s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}