/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* キャンバス */
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* メインコンテナ */
.container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px;
    background: rgba(10, 10, 10, 0.85);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ヘッダー */
.header {
    margin-bottom: 30px;
}

h1 {
    font-size: 3em;
    margin-bottom: 0.3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientMove 4s ease infinite;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.description {
    font-size: 1.1em;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 言語切り替え */
.lang-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.lang-btn {
    padding: 6px 16px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* コントロール */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-btn,
.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.control-btn:hover:not(:disabled),
.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.control-btn svg {
    width: 20px;
    height: 20px;
}

/* 設定 */
.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.setting label {
    font-size: 0.9em;
    opacity: 0.7;
    font-weight: 500;
}

select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin-top: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.value {
    font-size: 0.85em;
    opacity: 0.6;
    margin-top: 2px;
}

/* 色情報 */
.color-info {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.color-display {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.color-details {
    text-align: left;
}

.color-value {
    font-size: 1.2em;
    font-weight: 600;
    font-family: "Menlo", "Monaco", monospace;
    margin-bottom: 4px;
}

.frequency-value {
    font-size: 0.9em;
    opacity: 0.7;
}

/* ステータス */
.status {
    font-size: 0.95em;
    opacity: 0.7;
    margin-top: 10px;
}

/* 周波数バー */
.frequency-bars {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    z-index: 5;
    padding: 0 20px;
    pointer-events: none;
}

.frequency-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px 4px 0 0;
    transition: all 0.1s ease;
    max-width: 15px;
}

/* オーディオプレイヤー */
#audioPlayer {
    width: 100%;
    margin-top: 20px;
    opacity: 0.8;
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2em;
    }
    
    .container {
        padding: 20px;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    .control-btn,
    .file-label {
        width: 100%;
        justify-content: center;
    }
    
    .settings {
        grid-template-columns: 1fr;
    }
    
    .frequency-bars {
        height: 80px;
    }
}