:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --accent-color: #10b981; 
    --alert-color: #ef4444;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}
.dashboard {
    width: 100%;
    max-width: 1100px;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #334155;
    padding-bottom: 20px;
}
.live-tag {
    background: var(--alert-color);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 10px;
    animation: blink 1.5s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }
#startBtn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}
#startBtn:hover { transform: scale(1.05); }
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.video-container {
    position: relative;
    background: black;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #334155;
    height: 480px;
}
#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotateY(180deg); 
}
#output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.stat-card h3 {
    margin: 0 0 10px 0;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#focusPercent, #blinkCount, #timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}
.progress-bar {
    background: #334155;
    height: 8px;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}
#focusBar {
    height: 100%;
    background: var(--accent-color);
    width: 0%; 
    transition: width 0.3s linear;
}
#heatmapArea {
    margin-top: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stats-panel.pip-mode {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(10px); 
    padding: 10px;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: none;
}
.stats-panel.pip-mode .stat-card {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    margin-bottom: 5px;
    padding: 10px;
}
.stats-panel.pip-mode h3 {
    font-size: 0.7rem;
    margin-bottom: 2px;
}
.stats-panel.pip-mode #focusPercent, 
.stats-panel.pip-mode #blinkCount, 
.stats-panel.pip-mode #timer {
    font-size: 1.5rem; 
}
#autoBreakOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease-out;
}
.break-card {
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    max-width: 400px;
}
.break-card h2 {
    color: var(--accent-color);
    margin-top: 0;
    font-size: 2rem;
    letter-spacing: 2px;
}
#breakClock {
    display: block;
    font-size: 4rem;
    font-weight: 800;
    margin: 20px 0;
    color: var(--text-main);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}