:root {
    --bg-page: #fffbf7; 
    --bg-card: #ffffff;
    --primary: #6366f1; 
    --primary-soft: #eef2ff;
    --text-main: #2d3748; 
    --text-muted: #718096;
    --border: #f0e6dd; 
    --success: #22c55e;
    
    --font: 'Nunito', sans-serif; 
    --radius-card: 24px; 
    --radius-btn: 16px;
    --shadow-float: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

body.dark {
    --bg-page: #111827; 
    --bg-card: #1f2937;
    --primary: #818cf8; 
    --primary-soft: #312e81;
    --text-main: #f3f4f6; 
    --text-muted: #9ca3af;
    --border: #374151; 
    --success: #34d399;
    --shadow-float: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-page);
    font-family: var(--font);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

.hidden { display: none !important; }

.app-layout {
    width: 100%;
    background: var(--bg-page);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

@media (min-width: 768px) {
    body { align-items: center; padding: 40px; }
    .app-layout {
        max-width: 400px; 
        height: 85vh;
        max-height: 850px;
        border-radius: 40px;
        background: var(--bg-card);
        box-shadow: 0 20px 60px -15px rgba(0,0,0,0.1);
        border: 8px solid var(--bg-card);
        position: relative;
        overflow: hidden;
    }
}

.background-decor {
    position: fixed; top: -10%; left: -10%; width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%; z-index: -1; pointer-events: none;
}

.app-header {
    padding: 32px 24px 16px;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}

.brand { 
    display: flex; align-items: center; gap: 12px; 
    max-width: 100%;
}

.logo-icon { 
    width: 42px; 
    height: 42px; 
    object-fit: contain; /* Garante que o logo não distorça */
    flex-shrink: 0;
}

.logo-text { font-weight: 800; font-size: 20px; color: var(--text-main); }

.streak-badge {
    font-size: 11px; font-weight: 700; color: #f59e0b;
    display: flex; align-items: center; gap: 4px; margin-top: 2px;
}

.header-controls { display: flex; gap: 8px; }

.icon-btn {
    background: var(--primary-soft);
    border: none; width: 40px; height: 40px; border-radius: 50%;
    color: var(--primary); cursor: pointer; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover { background: #dfe7ff; transform: rotate(15deg); }
body.dark .icon-btn:hover { background: #4338ca; }

.container { 
    padding: 24px; 
    flex: 1; 
    display: flex; 
    flex-direction: column;
    overflow-y: auto; 
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-enter {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stagger-item {
    opacity: 0; 
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }

.title-center { text-align: center; margin-bottom: 32px; font-weight: 800; }
.energy-list { display: flex; flex-direction: column; gap: 12px; }

.energy-card {
    background: var(--bg-card);
    border: 2px solid transparent; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-radius: var(--radius-card);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    cursor: pointer; width: 100%; text-align: left;
    font-family: var(--font); color: var(--text-main);
    transition: all 0.2s;
}
.energy-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.energy-icon-box {
    font-size: 24px; color: var(--primary);
    background: var(--primary-soft);
    padding: 10px; border-radius: 14px;
}
.energy-label { font-weight: 700; font-size: 16px; }

.progress-header { margin-bottom: 32px; }
.progress-info { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.greeting-text { font-weight: 800; color: var(--primary); font-size: 18px; }
.counter-text { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.progress-track { height: 8px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); width: 0%; transition: width 0.6s ease; }

.hero-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-float);
    margin-bottom: 32px;
    position: relative; overflow: hidden;
    border: 1px solid var(--border);
}
.hero-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, var(--primary), #a5b4fc);
}

.hero-icon { font-size: 48px; color: var(--primary); margin-bottom: 16px; display: inline-block; }
.hero-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.hero-desc { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; font-size: 15px; }

/* Estilos do Seletor de Som */
.sound-selector-wrapper {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 16px;
    color: var(--text-muted); font-size: 14px; font-weight: 700;
}
#sound-select {
    padding: 6px 12px; border-radius: 12px;
    border: 2px solid var(--border);
    background-color: var(--bg-page); color: var(--text-main);
    font-family: var(--font); font-weight: 700; font-size: 14px;
    cursor: pointer; outline: none; transition: all 0.2s;
}
#sound-select:hover { border-color: var(--primary); }
#sound-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.timer-display {
    font-size: 48px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-main); margin: 16px 0; letter-spacing: -2px;
}

.timer-controls { display: flex; gap: 8px; }

.pulsing { animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }

.btn-primary {
    width: 100%; padding: 16px;
    background: var(--text-main); color: var(--bg-card);
    border: none; border-radius: var(--radius-btn);
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: transform 0.1s, background 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary.success { background: var(--success); color: white; }

.btn-secondary {
    padding: 16px; flex: 1;
    background: var(--primary-soft); color: var(--primary);
    border: none; border-radius: var(--radius-btn);
    font-weight: 700; cursor: pointer;
}

.input-group { display: flex; gap: 8px; margin-bottom: 24px; }

#new-task-input {
    flex: 2;
    padding: 12px 16px; border: 2px solid var(--border);
    border-radius: var(--radius-btn); font-family: var(--font);
    font-size: 16px; outline: none; transition: border-color 0.2s;
    background: var(--bg-card); color: var(--text-main);
}
#new-task-input:focus { border-color: var(--primary); }

#new-task-time {
    flex: 0.8; min-width: 60px; text-align: center;
    padding: 12px 8px; border: 2px solid var(--border);
    border-radius: var(--radius-btn); font-family: var(--font);
    font-size: 16px; outline: none; transition: border-color 0.2s;
    background: var(--bg-card); color: var(--text-main);
}
#new-task-time:focus { border-color: var(--primary); }

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

#btn-add-task {
    width: 50px; background: var(--text-main); color: var(--bg-card);
    border: none; border-radius: var(--radius-btn);
    cursor: pointer; font-size: 20px; display: flex; 
    align-items: center; justify-content: center;
}

.section-title { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; }
.task-row {
    padding: 16px 0; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; opacity: 0.7;
}

.empty-state { text-align: center; padding-top: 40px; animation: fadeInUp 0.8s ease; }
.empty-illustration { font-size: 64px; color: var(--success); margin-bottom: 16px; }

.btn-outline {
    margin-top: 24px; padding: 12px 24px;
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary-soft); border-radius: var(--radius-btn);
    font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); background: var(--primary-soft); }