* {
    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;
}

.container {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f23 100%);
    padding: 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #333;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.controls {
    background: #0a0a0a;
    padding: 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
    max-height: 200px;
    overflow-y: auto;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #ccc;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: #333;
    color: white;
}

.btn-secondary:hover {
    background: #444;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.preset-select {
    width: 100%;
    padding: 0.5rem;
    background: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.preset-select:hover {
    border-color: #667eea;
}

.new-body-controls {
    margin-top: 0.5rem;
}

.hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
}

#canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.info-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.info-panel p {
    margin-bottom: 0.5rem;
}

.info-panel p:last-child {
    margin-bottom: 0;
}

.info-panel span {
    color: #667eea;
    font-weight: 600;
}

footer {
    background: #0a0a0a;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #666;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* スクロールバーのスタイリング */
.controls::-webkit-scrollbar {
    width: 8px;
}

.controls::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.controls::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.controls::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        max-height: 300px;
    }
    
    .control-group {
        width: 100%;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .info-panel {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

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

.play-icon, .pause-icon {
    display: inline-block;
    animation: pulse 2s infinite;
}