:root {
	--font-family: 'Outfit', sans-serif;
	--clock-size: 18vw;
	--clock-letter-spacing: 0.05em;

	/* Colors */
	--bg-dark: #111;
	--text-dark: #fff;
	--bg-light: #fff;
	--text-light: #111;
	--progress-color: rgba(255, 0, 0, 0.7);

	/* Spacing */
	--gap: 1rem;
	--gap-sm: 0.5rem;

	/* Input padding */
	--input-pad-y: 0.15rem;
	--input-pad-x: 0.3rem;

	/* Other */
	--preset-pad-y: 0.3rem;
	--preset-pad-x: 0.6rem;
	--preset-radius: 4px;
	--btn-pad-y: 0.4rem;
	--btn-pad-x: 0.8rem;
	--btn-radius: 6px;
	--progress-height: 0.5rem;
	--progress-transition: 0.2s;
	--footer-gap: 1rem;
}

/* Global Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
body {
	font-family: var(--font-family);
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	overflow: hidden;
}
body,
html.theme-light body,
body.theme-light {
	background: var(--bg-light);
	color: var(--text-light);
}

/* Dark only when class is present (html or body) */
html.theme-dark body,
body.theme-dark {
	background: var(--bg-dark);
	color: var(--text-dark);
}

/* Timer Display */
.timer-container {
	text-align: center;
}
.timer-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--gap-sm);
}
#clock {
	font-variant-numeric: tabular-nums;
	font-size: var(--clock-size);
	font-weight: 800;
	letter-spacing: var(--clock-letter-spacing);
	user-select: none;
}

/* Progress + Overtime positioning */
#progress-container {
	position: relative; /* for absolute overtime */
	width: 100%;
	border: 1px solid currentColor;
	padding: 2px;
	margin-bottom: var(--gap);
}
#progress {
	width: 100%;
	height: var(--progress-height);
	background: var(--progress-color);
	transition: width var(--progress-transition) linear;
}
/* Overtime centered 5px above bar */
#overtime {
	position: absolute;
	bottom: calc(100% + 5px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
	user-select: none;
}
#overtime.hidden {
	display: none;
}

/* Blink animation */
@keyframes blink {
	0%,
	50% {
		opacity: 1;
	}
	51%,
	100% {
		opacity: 0;
	}
}
.blink {
	animation: blink 1s step-end infinite;
}

/* Setup Section */
#setup {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: var(--gap);
	margin-bottom: var(--gap);
}

/* Presets + Inputs */
#presets-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--gap);
}
#presets button {
	padding: var(--preset-pad-y) var(--preset-pad-x);
	border: 1px solid currentColor;
	border-radius: var(--preset-radius);
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	transition: background 0.2s;
}
#presets button:hover {
	background: rgba(255, 255, 255, 0.1);
}

#custom-container {
	display: flex;
	align-items: center;
	gap: var(--gap-sm);
}
#custom-container .label {
	font-weight: 600;
	color: inherit;
}

/* Native number inputs */
#input-minutes,
#input-seconds {
	width: 6ch; /* allow two digits + spinner */
	padding: var(--input-pad-y) var(--input-pad-x);
	border: 1px solid currentColor;
	border-radius: var(--preset-radius);
	background: var(--bg-light);
	color: var(--text-light);
	font: inherit;
	text-align: center;
	appearance: auto;
}
#input-minutes::-webkit-inner-spin-button,
#input-minutes::-webkit-outer-spin-button,
#input-seconds::-webkit-inner-spin-button,
#input-seconds::-webkit-outer-spin-button {
	-webkit-appearance: auto;
	margin: 0;
}
.separator {
	user-select: none;
	color: inherit;
}

/* Controls */
#controls {
	display: flex;
	gap: var(--gap-sm);
	justify-content: center;
	margin-top: calc(var(--gap) * 2);
}
.icon-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: var(--btn-pad-y) var(--btn-pad-x);
	border-radius: var(--btn-radius);
	color: inherit;
	transition: background 0.2s;
}
.icon-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}
.material-icons {
	font-size: 2rem;
	vertical-align: middle;
}

/* Footer: two rows */
footer {
	position: fixed;
	bottom: var(--footer-gap);
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(var(--footer-gap) / 2);
}
.footer-controls {
	display: flex;
	gap: var(--footer-gap);
	align-items: center;
}
#footer-info {
	font-size: 0.85rem;
	color: currentColor;
}
footer a {
	color: inherit;
	text-decoration: underline;
}

/* Fullscreen mode: hide all except timer, its bar, and the fs button */
body.fullscreen #setup,
body.fullscreen footer {
	display: none !important;
}
body.fullscreen #controls > :not(#fs) {
	display: none !important;
}
