Lines 8-50
1. Visual states make the timer easier to read at a glance
The page uses simple CSS variables and state-based background colours so “idle”, “running”, “paused”, “countdown”, and “done” all feel different without adding complexity.
:root {
--bg-idle: #111;
--bg-run: #0f7a2a;
--bg-pause: #b38f00;
--bg-countdown: #4a4a00;
--bg-done: #8b0000;
--ui-bg: rgba(0, 0, 0, 0.35);
--ui-bg-hover: rgba(0, 0, 0, 0.5);
}
html,
body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--bg-idle);
color: #fff;
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
Arial, sans-serif;
transition: background 200ms ease-in-out;
text-align: center;
user-select: none;
padding: 2vmin;
}
body[data-state="idle"] {
background: var(--bg-idle);
}
body[data-state="running"] {
background: var(--bg-run);
}
body[data-state="paused"] {
background: var(--bg-pause);
}
body[data-state="countdown"] {
background: var(--bg-countdown);
}
body[data-state="done"] {
background: var(--bg-done);
}