/* One Hit Wonder: five-tile board, one played row, one live row */

.ohw-tagline {
	text-align: center;
	margin: 6px 0 10px 0;
	font-size: 95%;
}

#whitebox {
	position: relative;
	text-align: center;
}

.ohw-row {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 6px 0;
}

.tiles {
	line-height: 62px;
	box-sizing: border-box;
	border: 2px solid rgb(211, 214, 218);
	width: 62px;
	height: 62px;
	font-size: 32px;
	font-weight: 700;
	justify-content: center;
	align-items: center;
	display: inline-flex;
	transition: background-color 0.5s ease-in-out;
	vertical-align: middle;
	text-transform: uppercase;
}

.tiles.filled {
	border-color: #888;
}

#row1 .tiles {
	border-color: transparent;
}

.correct {
	background-color: green;
	color: white;
}

.misplaced {
	background-color: orange;
	color: white;
}

.unused {
	background-color: #666;
	color: white;
}

.ohw-legend { display: inline-flex; align-items: center; gap: 6px; }
.ohw-swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 3px;
	vertical-align: middle;
}

#ohw-message {
	min-height: 1.6em;
	margin: 8px 0 0 0;
	font-weight: 600;
}

#ohw-misses {
	min-height: 1.4em;
	font-size: 90%;
	color: firebrick;
}

/* Wrong guess: the bad-password treatment */
.ohw-row.wrong .tiles {
	background-color: firebrick;
	border-color: firebrick;
	color: white;
	animation: ohw-flash 0.5s ease-in-out 4;
}

@keyframes ohw-flash {
	0%, 100% { background-color: firebrick; border-color: firebrick; color: white; }
	50% { background-color: #ffd6d6; border-color: firebrick; color: firebrick; }
}

.ohw-row.shake {
	animation: ohw-shake 0.4s;
}

@keyframes ohw-shake {
	10%, 90% { transform: translateX(-2px); }
	20%, 80% { transform: translateX(4px); }
	30%, 50%, 70% { transform: translateX(-6px); }
	40%, 60% { transform: translateX(6px); }
}

.tiles.reveal {
	animation: ohw-pop 0.3s;
}

@keyframes ohw-pop {
	50% { transform: scale(1.12); }
}

#custom-keyboard {
	max-width: 99vw;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 20px;
	user-select: none;
}

#custom-keyboard .key.unused {
	background-color: #666;
	color: white;
}

#custom-keyboard .key.correct {
	background-color: green;
	color: white;
}

#custom-keyboard .key.misplaced {
	background-color: orange;
	color: white;
}

.keyboard-row {
	display: flex;
	justify-content: center;
	margin: 5px 0;
	width: 100vw;
	max-width: 560px;
	gap: 1px;
}

.keyboard-row-2 {
	max-width: 90vw;
}

@media (min-width: 600px) {
	.keyboard-row-2 { max-width: 504px; }
}

.key {
	background-color: #D3D3D3;
	border: none;
	border-radius: 5px;
	margin: 0 1px;
	padding: 10px 15px;
	font-size: 16px;
	color: #000;
	outline: none;
	flex: 1;
	cursor: pointer;
}

.key-special {
	flex: 2;
}

.key:active {
	background-color: #A9A9A9;
}

.enter, .backspace {
	flex-grow: 4;
}

.enter { font-size: 80%; white-space: nowrap; transition: background-color 0.2s, color 0.2s; }

/* Row is full: Enter becomes the obvious next move */
#custom-keyboard .key.enter.ready {
	background-color: green;
	color: white;
	font-weight: 700;
}

#custom-keyboard .key.enter.pulse {
	animation: ohw-enter-pulse 0.5s ease-out;
}

@keyframes ohw-enter-pulse {
	50% { transform: scale(1.08); }
}
.backspace { font-size: 150%; }

#the_results {
	margin: 12px 0;
	line-height: 1.5;
}

#the_results .share-grid {
	font-size: 150%;
	line-height: 1.2;
}

@media (max-width: 768px) {
	.tiles {
		line-height: 48px;
		width: 48px;
		height: 48px;
		font-size: 24px;
	}
}

@media (max-width: 420px) {
	.key { padding: 10px 8px; }
	.enter { font-size: 70%; padding: 10px 4px; }
	.backspace { padding: 10px 4px; }
}
