:root {
    --bg-color: #09090b;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#status-text {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.timer-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#timer-display {
    font-size: 6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -3px;
    color: var(--text-main);
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.1);
}

.controls button {
    border: none;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary { 
    background: var(--text-main); 
    color: var(--bg-color); 
}
.btn-primary:hover { 
    background: #d4d4d8; 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px rgba(255,255,255,0.1); 
}

.btn-secondary { 
    background: transparent; 
    border: 1px solid #3f3f46 !important; 
    color: var(--text-main); 
}
.btn-secondary:hover { 
    background: #27272a; 
}

.graph-section {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

canvas {
    width: 100%;
    height: 300px;
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal.active {
    display: flex;
    animation: scaleIn 0.2s ease-out forwards;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background-color: #18181b;
    padding: 40px 50px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid #27272a;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: -0.5px;
}
.modal-buttons button {
    padding: 14px 28px;
    margin: 0 8px;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
}
.modal-buttons button:active { transform: scale(0.95); }

.btn-success { background-color: var(--accent); color: #000; }
.btn-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3) !important; }
.btn-success:hover { box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
.btn-danger:hover { background-color: rgba(239, 68, 68, 0.2); }