* {
    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, #1a1a2e 0%, #16213e 100%);
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

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

.subtitle {
    font-size: 1.2em;
    color: #aaa;
    margin-bottom: 20px;
}

.language-selector {
    display: inline-flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 25px;
}

.lang-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
}

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

.lang-btn.active {
    background: #4a7c7e;
    color: #fff;
}

.sound-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sound-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.sound-card.active {
    background: rgba(74, 124, 126, 0.3);
    border-color: #4a7c7e;
    box-shadow: 0 0 20px rgba(74, 124, 126, 0.3);
}

.sound-card h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #7ec8e3;
}

.sound-card p {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.frequency-control,
.volume-control,
.timer-control {
    margin-top: 20px;
}

.frequency-control label,
.volume-control label,
.timer-control label {
    display: block;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 0.9em;
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #7ec8e3;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #9bd4e4;
}

.freq-value,
.volume-value {
    display: inline-block;
    margin-left: 10px;
    color: #7ec8e3;
    font-weight: bold;
}

select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

select option {
    background: #1a1a2e;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.control-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-btn.play {
    background: linear-gradient(45deg, #4a7c7e, #7ec8e3);
    color: #fff;
}

.control-btn.play:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(126, 200, 227, 0.3);
}

.control-btn.stop {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn.stop:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

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

.volume-control,
.timer-control {
    flex: 1;
    min-width: 200px;
}

.visualization {
    margin-bottom: 40px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
}

#visualizer {
    width: 100%;
    height: 200px;
    border-radius: 10px;
}

.presets {
    text-align: center;
}

.presets h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #7ec8e3;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.preset-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.preset-btn:hover {
    background: rgba(74, 124, 126, 0.3);
    border-color: #4a7c7e;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    margin-top: 60px;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .sound-types {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .volume-control,
    .timer-control {
        width: 100%;
    }
    
    .preset-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .preset-btn {
        width: 200px;
    }
}

/* アニメーション */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.sound-card.active {
    animation: pulse 2s infinite;
}

/* ダークモード対応 */
@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
        color: #333;
    }
    
    .sound-card {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .sound-card.active {
        background: rgba(74, 124, 126, 0.1);
    }
    
    h1 {
        color: #2c5558;
    }
    
    .subtitle,
    .sound-card p {
        color: #666;
    }
    
    .lang-btn,
    select,
    footer {
        color: #333;
    }
    
    input[type="range"] {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .control-btn.stop {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
        color: #333;
    }
}