:root {
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --success-color: #10b981; /* Emeraude */
    --success-hover: #059669;
    --danger-color: #ef4444; /* Rouge/Malus */
    --danger-hover: #dc2626;
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-blur: blur(12px);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --radius-xl: 1.5rem;
    --radius-md: 0.75rem;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.main-header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.box-glass {
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.p-large { padding: 2rem; }
.p-xlarge { padding: 3rem; text-align: center; }

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 0.5rem;
}

/* Grids */
.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media(min-width: 768px) {
    .layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .span-2 {
        grid-column: span 2;
    }
}

/* User Selection */
.user-selection {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.user-cards {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.user-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 140px;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border: 2px solid var(--primary-color);
}

.user-card .emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.user-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-animate:active {
    transform: scale(0.95);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Tasks Buttons */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
    width: 100%;
}

.task-btn:hover {
    transform: translateX(5px);
}

.btn-positive {
    border-left: 5px solid var(--success-color);
}
.btn-positive:hover { background: #d1fae5; }
.btn-positive strong { color: var(--success-color); }

.btn-negative {
    border-left: 5px solid var(--danger-color);
}
.btn-negative:hover { background: #fee2e2; }
.btn-negative strong { color: var(--danger-color); }

/* Score display (Parent / Child) */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.parent-score .score-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-color);
}
.child-score .score-number {
    font-size: 6rem;
    font-weight: 900;
    color: #f59e0b; /* Ambre/Or */
    text-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.score-unit {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.motivation {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Rewards Grid (Child) */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.reward-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-card:hover { transform: translateY(-10px); }

.reward-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.reward-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.reward-card.afford {
    border: 3px solid var(--success-color);
}
.reward-card.locked {
    opacity: 0.8;
    filter: grayscale(40%);
}

.btn-claim {
    background: var(--success-color);
    color: white;
    width: 100%;
    margin-top: 1rem;
    border-radius: 50px;
}
.btn-claim:hover { background: var(--success-hover); }

/* Progress bar inside locked reward */
.locked-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin-top: 1rem;
    overflow: hidden;
}
.locked-bar .progress {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s ease;
}
.need-more {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 700;
}

/* Animations */
.fade-in { animation: fadeIn 0.8s ease backwards; }
.bounce { animation: bounce 2s infinite ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.data-table th { background: #f8fafc; font-weight: 700; }
.cost-badge { background: #f59e0b; color: white; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.9rem; }

/* Log List */
.log-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.log-item {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
}
.log-date { font-size: 0.85rem; color: var(--text-muted); width: 120px;}
.log-desc { flex: 1; font-weight: 700;}
.log-diff.positive { color: var(--success-color); font-weight: 900;}
.log-diff.negative { color: var(--danger-color); font-weight: 900;}
