@import url("../games.css?v=2026.01.27a");

:root {
	--tile-width: 12rem;
	--tile-height: 7rem;
	--tile-gap: 0.5rem;
	--text-color: #111112;
	--primary-color: #b049ff;
    --secondary-color: #7b34ff;
	--color-gradient: linear-gradient(var(--primary-color), var(--secondary-color));
	--solve-transition-time: 1000ms;
	--solve-shake-time: 800ms;

	--bad: #eb1c5a;
}

html, body {
	height: 100%;
	margin: 0;
}

p, h1, h2 {
	margin: 0;
}

body {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 1rem;
}

a.title {
	font: 2rem 'Clash Display';
    font-weight: 500;
    color: var(--secondary-color);
    text-decoration: none;

	margin: 0;
    margin-bottom: -2rem;
}

h1.title {
	display: block;
	color: var(--text-color);
	font: 6rem "Cabinet Grotesk";
	font-weight: 900;
	white-space: nowrap;

	margin: 0;
	margin-bottom: -1.25rem;
}

span.gradient {
	background: var(--color-gradient);
	background-clip: text;
	color: transparent;
}

.navbar.regular {
	position: relative;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;

	justify-content: center;
	margin-bottom: 3rem;
}

#tip {
	font: 1.5rem "Cabinet Grotesk";
}

.grid {
	display: grid;
	grid-template-rows: repeat(attr(data-rows type(<number>)), var(--tile-height));
	grid-template-columns: repeat(attr(data-columns type(<number>), 4), var(--tile-width));
	gap: var(--tile-gap);
	align-items: stretch;
}

.grid.new > .tile {
	transform: translateY(0.5rem);
	opacity: 0;
	animation: fade-up 1s var(--smooth-easing) forwards;
}

@keyframes fade-up {
	from {
		translate: 0 1rem;
		opacity: 0;
	}

	to {
		transform: none;
		opacity: 1;
	}
}

.tile {
	position: relative;
	background-color: #eeeeef;
	border-radius: 0.5rem;

	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	outline: none;

	font: 1.25rem "Martian Mono";
	font-weight: 600;
	color: var(--text-color);
	cursor: pointer;
	overflow: hidden;
	text-wrap: pretty;
	word-break: break-all;
	hyphens: auto;

	transition:
		background-color 200ms,
		transform var(--solve-transition-time);
	transition-timing-function: cubic-bezier(0.8, 0, 0.2, 1);
}


.tile:not(.selected):hover {
	background-color: #ddddde;
}

.tile.selected {
	color: white;
	background-color: #222223;
	z-index: 2;
}

.tile.shake {
	animation: tile-shake var(--solve-shake-time);
}

@keyframes tile-shake {
	25% { rotate: -7deg; }
	50% {
		scale: 1.05;
		rotate: 7deg;
	}
	75% { rotate: -7deg; }
}

.tile.wrong {
	animation: tile-wrong 800ms;
}

@keyframes tile-wrong {
	50% {
		color: white;
		background-color: var(--bad);
	}
}

.group {
	position: relative;
	background-color: #6ad0ff;
	border-radius: 0.5rem;
	font: 1.25rem "Martian Mono";

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;

	grid-column: 1 / -1;
	order: -1;
	z-index: 10;
	overflow: hidden;

	animation: group-pulse 0.7s var(--bounce-easing);
}

@keyframes group-pulse {
	from {
		scale: 1.1;
		box-shadow: 0 0.5rem 24px #0000002a;
	}
}

.group h2 {
	font-family: inherit;
	font-size: bigger;
	font-weight: 900;
	white-space: nowrap;
	text-align: center;
}

.group p {
	font-family: inherit;
	font-size: inherit;
	font-weight: 500;
	text-align: center;
}

.options {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 1rem;
}

.options > button {
	background: none;
	box-sizing: border-box;
	border: 2px solid #cccccd;
	border-radius: 100rem;

	font: 1.5rem "Cabinet Grotesk";
	font-weight: 700;
	color: var(--text-color);
	padding: 1rem 2rem;
	cursor: pointer;
	white-space: nowrap;

	transition:
		background-color 200ms,
		border-color 200ms,
		color 200ms,
		opacity 200ms;
}

.options > button:hover {
	border-color: #aaaaab;
}

#submit {
	background: var(--primary-color);
	color: white;
	border: none;
}

#submit.disabled {
	background-color: #eeeeef;
	color: var(--text-color);
	cursor: default;
}

dialog .example {
	align-self: stretch;
	margin-bottom: 1.5rem;
}

dialog .grid {
	align-self: stretch;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(4, 6rem);
	gap: 0.25rem;
}

dialog .tile, dialog .group {
	height: 100%;
}

dialog .tile {
	font-size: 1rem;
}

dialog .group {
	font-size: 1rem;
	animation: none;
}


#how-to-play ul > li {
	margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
	:root {
        --tile-gap: 0.25rem;
    }

    html { font-size: 14px; }
	body {
		justify-content: start;
		gap: 1.25rem;
	}

	.title { display: none !important; }

	.navbar.mobile { justify-content: start; }
	.navbar.mobile h1 {
		flex: 1;
		white-space: nowrap;
	}

	.navbar.mobile button {
		font-size: 1rem;
		padding-inline: 1rem;
	}

	.grid {
		align-self: stretch;
		margin-inline: 1rem;
		gap: 0.5rem;
		grid-template-columns: repeat(attr(data-columns type(<number>), 4), minmax(0, 1fr));
		grid-template-rows: repeat(attr(data-rows type(<number>), 4), minmax(0, 1fr));
	}

	.tile {
		font-size: clamp(0.5rem, 3vw, 1.25rem);
		aspect-ratio: 1;
	}

	.group {
		font-size: clamp(0.5rem, 3vw, 1.25rem);
		aspect-ratio: auto;
	}

	.options { gap: 0.5rem; }
	.options > button {
		font-size: clamp(0.75rem, 3vw, 1.25rem);
		padding: clamp(0.5rem, 2.5vw, 1rem) clamp(1rem, 5vw, 2rem)
	}
}

@media (max-width: 425px) {
	.group p { display: none; }
	.group h2 {
		white-space: normal;
		text-wrap: pretty;
	}
}