#pixels {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	box-sizing: border-box;
	pointer-events: none;
	z-index: 3;
	/* background-color: green;
	opacity: 0.5; */
}

.pixel {
	background-color: var(--bg-color);
	opacity: 0;
	border: 1px solid var(--bg-color);
}

.pixel.half {
	opacity: 0.5;
}

.pixel.visible {
	opacity: 1;
}

#tooltip {
	width: 100%;
	padding: 12px;
	/*background: linear-gradient(to bottom, #65a7fc 0%, #4d91ff 50%, #4385ee 100%);*/
	background-color: var(--theme-blue);
	border: var(--gap) solid var(--frame-color);
	border-bottom: 0;
	transition:
		opacity 0.3s linear,
		background-color 0.3s linear,
		box-shadow 0.3s linear;
	opacity: 0;
	color: white;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	flex-shrink: 0;
	justify-content: space-between;
	align-items: center;
	z-index: 1;
}
#game-container.shadow #tooltip {
	box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.16);
}

#tooltip.red {
	background-color: rgb(255, 20, 75);
}

#score-counter {
	visibility: hidden;
	font-size: 1.1rem;
	width: 100%;
	padding-right: 10px;
	text-align: right;
	font-family: "Tiny5", monospace;
	transition:
		transform 0.3s linear,
		color 0.3s linear;
}

#score-counter.enlarge {
	transform: scale(1.4);
}

#score-counter.debit {
	/* transform: scale(0.9); */
}

#tooltip-right {
	margin-left: auto;
	display: flex;
	flex-shrink: 1;
	flex-direction: column;
	align-items: center;
}

.face-container {
	height: 56px;
	margin-bottom: -5px;
	cursor: pointer;
	position: relative;
}

.face-container img {
	height: 56px;
}

.face-container #glasses {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	z-index: 1;
	pointer-events: none;
}

#game-container {
	margin: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/*width: min(100%, 1000px);*/
	width: 100%;
	height: 100%;
}

#grid {
	position: relative;
	border: var(--gap) solid transparent;
	aspect-ratio: 1 / 1;
	gap: var(--gap);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	transition: 
		background-color 0.3s linear,
		box-shadow 0.3s linear;
	z-index: 2;
}

#grid>.cell-wrapper {
	flex: 0 0 calc((100% - (var(--columns) - 1) * var(--gap)) / var(--columns));
	height: calc((100% - (var(--rows) - 1) * var(--gap)) / var(--rows));
}

#grid.active {
	background-color: var(--frame-color);
}
#game-container.shadow #grid.active {
	box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.16);
}

#tooltip.active {
	opacity: 1 !important;
}

#splash-image {
	z-index: 6;
	opacity: 0;
}

#continue-prompt {
	z-index: 5;
	text-align: center;
	opacity: 0;
	will-change: opacity;
	font-family: "Tiny5";
	font-size: min(18vw, 7rem);
	color: rgb(247, 247, 247);
	line-height: 120%;
	text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.25);
	transition:
		opacity 0.5s linear;
}

#continue-prompt.fade-in {
	opacity: 0.8 !important;
}

#in-game-message {
	margin-left: 0.06em;
	z-index: 5;
	opacity: 0;
	text-align: center;
	will-change: opacity;
	font-family: "Tiny5";
	font-size: 40vw;
	color: rgb(255, 255, 255);
	/* color: transparent; */
	mix-blend-mode: darken;
	text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
	/* backdrop-filter: blur(4px); */
	transition:
		opacity 0.5s linear;
}
#splash-container {
	z-index: 5;
	opacity: 0;
	will-change: transform, opacity;
	/* width: min(90vw, 600px); */
	width: 90%;
	height: 400px;
	transition: opacity 1s ease-out;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	row-gap: 18px;
}

#splash-container.fade-in #splash-text {
	/* opacity: 0.8 !important; */
}

#splash-text {
	width: 100%;
	display: inline-block;
	text-align: center;
	font-family: "Coral Pixels";
	font-smooth: never;
	/* font-size: min(5rem, 14vw); */
	font-size: 44px;
	line-height: 1.2;
}

[data-theme="dark"] #splash-text {
	font-family: "Roboto";
	font-weight: bold;
	color: white;
}

/* ── Trend Histogram ─────────────────────────────────────────── */
#histogram-container {
	width: 100%;
	max-width: 500px;
	height: 80%;
	/* display: none; */
}
#histogram-container.hidden {
	display: none;
}
.trend-histogram {
	/* opacity: 0.5; */
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 15px;
	height: 300px;
	/* padding: 0 4px 20px; 20px bottom reserved for labels */
	box-sizing: border-box;
}

.hist-col {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	height: 100%;
	flex: 1 1 0;
	max-width: 60px;
	min-width: 0;
}

.hist-track {
	position: relative;
	flex: 1;
	width: 100%;
	
}

.hist-fill {
	box-shadow: var(--card-shadow);
	overflow: hidden;
	position: absolute;
	padding-top: 10px;
	bottom: 0;
	left: 0;
	right: 0;
	/* border-radius: 6px 6px 0 0; */
	/* box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.25); */
	transition:
		height 1.2s cubic-bezier(0.34, 1.4, 0.64, 1),
		background-color 0.5s linear;
}

.hist-label {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 16px;
	font-family: "Noto Sans";
	text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5);
	font-weight: 600;
	color: var(--text-color);
}

/* ── DEBUG: force histogram + splash always visible ─────────── */
/* Remove this block when done editing */
/* #splash-container,
#splash-container #splash-text {
	opacity: 1 !important;
} */