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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gold: #FFD700;
    --bg-dark: #0f0f23;
    --bg-light: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --card-bg: rgba(26, 26, 46, 0.8);
    --border-color: rgba(255, 215, 0, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ヘッダー */
.header {
    padding: 2rem 0;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.lang-selector {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-selector:hover {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ヒーローセクション */
.hero {
    padding: 3rem 0;
    text-align: center;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

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

.slider-value {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 30px;
}

.generate-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* メインコンテンツ */
.main-content {
    padding: 3rem 0;
}

/* 数列表示 */
.sequence-section {
    margin-bottom: 3rem;
}

.sequence-display {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

.sequence-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    min-width: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.seq-index {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.seq-value {
    display: block;
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ビジュアライゼーショングリッド */
.viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.viz-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.viz-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--gold);
}

#spiral-canvas {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

#bar-chart {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* 比率表示 */
.info-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--gold);
    font-weight: 600;
}

.ratio-display {
    max-height: 200px;
    overflow-y: auto;
    margin: 1rem 0;
}

.ratio-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 黄金比計算機 */
.calculator {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
}

.calc-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

input[type="number"] {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    width: 120px;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.calc-results {
    display: grid;
    gap: 1rem;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.calc-value {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.1rem;
}

/* 教育セクション */
.education-section {
    margin-top: 4rem;
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 24px;
}

.education-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.edu-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.edu-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.edu-card h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.edu-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* フッター */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer p {
    color: var(--text-secondary);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .viz-grid {
        grid-template-columns: 1fr;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
    }
    
    input[type="range"] {
        width: 150px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.viz-card {
    animation: fadeIn 0.6s ease-out;
}

.edu-card {
    animation: fadeIn 0.8s ease-out;
}