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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #001122 0%, #003366 100%);
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.subtitle {
    font-size: 1.2em;
    color: #00ffff;
    position: relative;
    z-index: 1;
}

.generator-section {
    background: #0a0a0a;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #222;
}

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

.quantum-visualization {
    position: relative;
    height: 300px;
    background: radial-gradient(ellipse at center, #001122 0%, #000 100%);
    border-radius: 15px;
    overflow: hidden;
}

#quantumCanvas {
    width: 100%;
    height: 100%;
}

.random-output {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.number-display {
    font-size: 4em;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
}

.entropy-meter {
    width: 100%;
    max-width: 300px;
}

.entropy-meter label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #888;
}

.meter-bar {
    height: 10px;
    background: #222;
    border-radius: 5px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: #00ff00;
    transition: width 0.3s ease, background-color 0.3s ease;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 0.9em;
    color: #888;
}

.control-group input {
    padding: 10px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
}

.control-group input:focus {
    outline: none;
    border-color: #00ffff;
}

.format-options {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.format-btn {
    padding: 10px 20px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-btn:hover {
    border-color: #00ffff;
    color: #00ffff;
}

.format-btn.active {
    background: #00ffff;
    color: #000;
    border-color: #00ffff;
}

.generate-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #0066cc 0%, #00ffff 100%);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
}

.generate-btn:active {
    transform: translateY(0);
}

.btn-text {
    display: inline-block;
}

.btn-loading {
    display: none;
}

.generate-btn.loading .btn-text {
    display: none;
}

.generate-btn.loading .btn-loading {
    display: inline-block;
}

.results-section {
    margin-top: 30px;
}

.results-section h3 {
    margin-bottom: 15px;
    color: #00ffff;
}

.results-container {
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.result-item {
    background: #222;
    padding: 8px 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #444;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #222;
    border-color: #00ffff;
}

.api-section {
    background: #0a0a0a;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #222;
}

.api-section h2 {
    margin-bottom: 20px;
    color: #00ffff;
}

.api-demo {
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.api-demo pre {
    margin: 0;
}

.api-demo code {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.api-key-btn {
    padding: 15px 30px;
    background: #00ffff;
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.api-key-btn:hover {
    background: #00cccc;
}

.stats-section {
    background: #0a0a0a;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #222;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: #00ffff;
}

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

.stat-card {
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card h4 {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #00ffff;
}

#distributionChart {
    width: 100%;
    height: 200px;
    background: #111;
    border-radius: 10px;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 0.9em;
}

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

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .quantum-display {
        grid-template-columns: 1fr;
    }
    
    .number-display {
        font-size: 3em;
    }
    
    .format-options {
        flex-wrap: wrap;
    }
    
    .result-actions {
        flex-wrap: wrap;
    }
}