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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

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

.subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section, .settings-section, .action-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.input-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.primary-btn, .secondary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
}

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

.primary-btn:active, .secondary-btn:active {
    transform: translateY(0);
}

.primary-btn svg, .secondary-btn svg {
    width: 20px;
    height: 20px;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

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

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: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
}

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

select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

select option {
    background: #1a1a2e;
}

.action-section {
    display: flex;
    gap: 1rem;
}

.visualization {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    height: 500px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#patternCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.status-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
    z-index: 10;
}

.status-message.success {
    background: rgba(46, 213, 115, 0.9);
}

.status-message.error {
    background: rgba(255, 71, 87, 0.9);
}

.info-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-section p {
    color: #b0b0b0;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
}

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.feature p {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 0;
}

footer {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.5);
    color: #666;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .input-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .visualization {
        height: 400px;
    }
}

/* フルスクリーン時のスタイル */
#patternCanvas:fullscreen {
    background: #000;
}

/* アニメーション */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.visualization {
    animation: pulse 4s ease-in-out infinite;
}