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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #6b7280;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* ヘッダー */
header {
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
    margin-bottom: 30px;
}

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

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--surface);
    font-size: 14px;
    cursor: pointer;
}

/* セクション共通 */
section {
    background-color: var(--surface);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

section h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

section h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* ストリークカード */
.streak-card {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.streak-icon {
    font-size: 48px;
}

.streak-info h2 {
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
}

.streak-days {
    font-size: 36px;
    font-weight: 700;
}

/* 統計グリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--background);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* タイマーセクション */
.timer-section {
    text-align: center;
    margin-bottom: 30px;
}

.timer {
    font-size: 48px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* 文字数入力セクション */
.word-count-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.word-count-section label {
    color: var(--text-secondary);
    font-weight: 500;
}

.word-count-section input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.word-count-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 目標セクション */
.goal-section {
    background-color: var(--background);
    border-radius: 8px;
    padding: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.3s ease;
}

.goal-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 名言セクション */
.quote-section {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    text-align: center;
}

.quote-section blockquote {
    font-size: 20px;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* チャートセクション */
.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: var(--background);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    position: relative;
    height: 300px;
}

/* 設定セクション */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-item label {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.setting-item input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
}

.setting-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ボタン */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-link {
    background: none;
    color: white;
    text-decoration: underline;
    padding: 5px 10px;
}

.btn-link:hover {
    opacity: 0.8;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* フッター */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header h1 {
        font-size: 22px;
    }
    
    .streak-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .word-count-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timer {
        font-size: 36px;
    }
    
    section {
        padding: 20px;
    }
    
    .chart-container {
        height: 250px;
    }
}