@charset "UTF-8";

html {
	background-color: black;
}
#bg-fixed {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: url("images/background.jpg");
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	z-index: -1;
}
body {
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
	font-family: "Roboto", Arial, sans-serif;
	line-height: 1;
}
html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
}
img {
	margin-top: 2px;
	filter: drop-shadow(0px 0px 6px rgba(0, 0, 0, 0.5));
}
#countdown {
	font-variant-numeric: tabular-nums;
}
.flash {
	animation: flash 1s linear infinite;
	color: #b21f27;
}
@keyframes flash {
	50% {
		opacity: 1;
		color: #f8d904;
	}
}
.main {
	max-height: 100vh;
	align-content: center;
	height: 100vh;
	width: 100%;
	margin: 0 auto;
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}
.buttons.justify-center {
	display: grid;
	align-content: center;
	width: 100%;
	min-width: 0;
}
.buttonrow {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(2, 1fr);
	align-content: space-evenly;
}
.buttonrowsingle {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	align-content: space-evenly;
}
.button {
	height: 8vh;
	font-size: 6vw;
	margin: 2vh;
	display: block;
	padding: 12px;
	border-radius: 24px;
	border: 3px solid white;
	color: white;
	font-family: inherit;
	font-weight: 600;
	white-space: nowrap;
	font-family: inherit;
}
.button:disabled {
	background-color: silver !important;
	color: dimgray !important;
}
.drop-shadow {
	filter: drop-shadow(0px 0px 6px rgba(0, 0, 0, 0.5));
}
.timer {
	display: grid;
	align-content: center;
	font-size: 80vw;
	font-family: "Anton", Arial, sans-serif;
	font-weight: 500;
	color: #f8d904;
	margin: 0;
	text-align: center;
	height: 100%;
	width: auto;
	min-width: 0;
	background: url(images/logo.svg);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	-webkit-text-stroke: 0.02em #222;
	letter-spacing: 0.04em;
}
.countdown {
	visibility: hidden;
	width: 100%;
	height: 100%;
	opacity: 1;
}
.settings {
	position: fixed;
	top: 8px;
	left: 50%;
	transform: translateX(-50%);
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	font-size: 14px;
	text-align: center;
	padding: 1rem;
	z-index: 5;
	border-radius: 8px;
	white-space: nowrap;
	cursor: pointer;
	line-height: 1.5;
}
.settingsOverlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 15;
	display: flex;
	justify-content: center;
	align-items: center;
}
.settingsButton {
	width: 100%;
	background-color: green;
	color: white;
	border: 2px solid white;
	padding: 12px 0;
	font-size: 24px;
	border-radius: 8px;
	text-align: center;
	font-weight: 600;
	font-family: inherit;
}
.settingsInput {
	font-size: 22px;
	text-indent: 0.1em;
	border-radius: 6px;
	font-family: inherit;
}
.settingsRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}
.settingsCaption {
	color: white;
	font-size: 18px;
	font-family: inherit;
	width: 75%;
}
.settingsControl {
	width: 74px;
	height: 36px;
}
.settingsInput,
.settingsToggle {
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	display: block;
	text-align: center;
	object-fit: contain;
	padding: 0;
	margin: 0;
	font-family: inherit;
}
.settingsForm {
	padding: 1.25rem;
	text-align: left;
	background-color: rgba(0, 0, 0, 0.6);
	border-radius: 20px;
	width: 280px;
	max-width: 90%;
}
.hidden {
	display: none !important;
}
#flash-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: white;
	opacity: 0;
	pointer-events: none;
	z-index: 100;
	transition: opacity 0.05s ease-in-out;
}
.input-error {
	border: 2px solid red !important;
	background-color: red;
	color: white;
}

/* Responsive hide utilities
   Each class only activates inside its own screen-size range,
   so combining them on the same element never causes conflicts.
   Small  : < 480px
   Medium : 480px – 767px
   Large  : 768px +                                              */
@media (max-width: 479px) {
	.hide-small { display: none !important; }
}
@media (min-width: 480px) and (max-width: 767px) {
	.hide-medium { display: none !important; }
}
@media (min-width: 768px) {
	.hide-large { display: none !important; }
}

/* Timer selector — display:contents makes all 6 items direct flex
   children of .help-buttons for even space-between in both orientations */
.timer-selector {
	display: contents;
}
.timer-option {
	cursor: pointer;
}
.timer-option input[type="radio"] {
	display: none;
}
.timer-option > span {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	height: 18px;
	color: rgba(255, 255, 255, 0.8);
	background-color: rgba(0, 0, 0, 0.8);
	border: 2px solid rgba(255, 255, 255, 0.25);
	line-height: 1;
	-webkit-user-select: none;
	user-select: none;
	transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.timer-option > span > span {
	margin-left: 4px;
}
.timer-option input[type="radio"]:checked + span {
	color: #f8d904;
	background-color: rgba(0, 0, 0, 0.8);
	border-color: #f8d904;
}
.help-buttons {
	position: fixed;
	top: calc(16px + env(safe-area-inset-top));
	left: 0;
	width: calc(100vw - 32px);
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 10;
	background-color: transparent;
	padding: 8px 16px;
	border-radius: 12px;
}
.help-buttons img {
	width: 32px;
	height: 32px;
	cursor: pointer;
	transition: transform 0.2s ease-in-out;
	z-index: 4;
}
.help-buttons img:hover {
	transform: scale(1.2);
}

@media (orientation: portrait) and (display-mode: standalone) {
	.main {
		margin-top: 64px;
		height: calc(100vh - 64px);
		max-height: calc(100vh - 64px);
	}
}
@media (orientation: portrait) and (display-mode: browser) {
	.main {
		height: 100dvh;
		max-height: 100dvh;
		margin-top: 0;
		box-sizing: border-box;
		padding-top: calc(env(safe-area-inset-top, 0px) + 68px);
	}
	.button {
		height: 8dvh;
		margin: 2dvh;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

@media (orientation: landscape) {
	.main {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		box-sizing: border-box;
		padding-left: calc(env(safe-area-inset-left, 0px) + 120px);
		padding-right: calc(env(safe-area-inset-right, 0px) + 16px);
	}
	.timer {
		font-size: 35vw;
	}
	.button {
		height: 8vw;
		font-size: clamp(14px, 2vw, 60px);
		margin: 5vh 4vh;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 12px;
		border-radius: 24px;
		border: 3px solid white;
		color: white;
		transform: translate(4px);
	}
	/* Help-buttons: vertical column on left, all 6 items evenly spaced */
	.help-buttons {
		top: 0;
		left: 0;
		width: calc(env(safe-area-inset-left, 0px) + 120px);
		height: 100dvh;
		box-sizing: border-box;
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-start;
		padding: calc(env(safe-area-inset-top, 0px) + 16px)
		         16px
		         calc(env(safe-area-inset-bottom, 0px) + 16px)
		         max(env(safe-area-inset-left, 0px), 16px);
	}
	/* Order: settings(1), 15(2), 30(3), 45(4), 60(5), info(6) */
	#settings-icon { order: 1; }
	.timer-selector > .timer-option:nth-child(1) { order: 2; }
	.timer-selector > .timer-option:nth-child(2) { order: 3; }
	.timer-selector > .timer-option:nth-child(3) { order: 4; }
	.timer-selector > .timer-option:nth-child(4) { order: 5; }
	.help-buttons > a { order: 6; }
}

/* Phone landscape (<1024px): numbers only, no text */
@media (orientation: landscape) and (max-width: 1023px) {
	.timer-option > span > span {
		display: none !important;
	}
}
/* Tablet landscape (1024-1365px): show "Secs" */
@media (orientation: landscape) and (min-width: 1024px) and (max-width: 1365px) {
	.timer-option > span > span.hide-small.hide-large {
		display: inline-flex !important;
	}
	.timer-option > span > span.hide-small.hide-medium {
		display: none !important;
	}
}
/* Laptop landscape (1366px+): wider column to fit "Seconds" */
@media (orientation: landscape) and (min-width: 1366px) {
	.main {
		padding-left: calc(env(safe-area-inset-left, 0px) + 150px);
	}
	.help-buttons {
		width: calc(env(safe-area-inset-left, 0px) + 150px);
	}
}

@media (orientation: landscape) and (display-mode: browser) {
	.main {
		height: 100dvh;
		max-height: 100dvh;
	}
}
