:root {
    --primary-color: #4A90E2;
    --secondary-color: #7ED321;
    --danger-color: #FF6B6B;
    --bg-color: #F8F9FA;
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

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

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

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.tagline {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
}

#languageSelect {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

#languageSelect:hover {
    border-color: var(--primary-color);
}

/* タイマーセクション */
.detox-timer {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 40px;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.status.active {
    color: var(--secondary-color);
}

.status.paused {
    color: var(--danger-color);
}

.timer-display {
    margin-bottom: 30px;
}

.time {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
    margin-bottom: 10px;
}

.points-earned {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.points-value {
    font-weight: 700;
    font-size: 2rem;
}

.start-button {
    background: linear-gradient(135deg, var(--primary-color), #357ABD);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    font-weight: 600;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.start-button.active {
    background: linear-gradient(135deg, var(--danger-color), #FF5252);
}

.motivation-message {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #666;
    min-height: 30px;
    font-style: italic;
}

/* 統計セクション */
.stats-section {
    margin-bottom: 40px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: #666;
}

/* 報酬セクション */
.rewards-section {
    margin-bottom: 40px;
}

.rewards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.reward-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.reward-card:hover {
    transform: translateX(5px);
}

.reward-icon {
    font-size: 3rem;
    width: 60px;
    text-align: center;
}

.reward-info {
    flex: 1;
}

.reward-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.reward-cost {
    color: var(--secondary-color);
    font-weight: 700;
}

.redeem-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.redeem-button:hover:not(:disabled) {
    background: #6BC617;
}

.redeem-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ヒントセクション */
.tips-section {
    margin-bottom: 40px;
}

.tips-carousel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-content {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* 通知 */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

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

.notification.success {
    background: var(--secondary-color);
}

.notification.error {
    background: var(--danger-color);
}

/* フッター */
footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 60px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .time {
        font-size: 3rem;
    }
    
    .detox-timer {
        padding: 30px 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rewards-list {
        grid-template-columns: 1fr;
    }
}