.flip .body {
	padding: 0 10px;
}
.flip .table-container {
	display: flex;
	justify-content: center;
	margin: 20px auto;
}
.flip .table {
	display: inline-grid;
	position: relative;
}
.flip .scores {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
.flip .scores span {
	font-weight: bold;
}
.flip .scores > div {
	text-align: left;
}
.flip .scores > div:nth-child(2) {
	text-align: right;
	position: relative;
}

.flip .controls {
	text-align: center;
	margin: 10px 0;
	order: -1;
}

.flip #pauseBtn,
.flip #settingsBtn {
	background-color: #3080D0;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
	transition: background-color 0.2s;
	margin: 0 5px;
}

.flip #pauseBtn:hover,
.flip #settingsBtn:hover {
	background-color: #2060A0;
}

.flip #pauseBtn:active,
.flip #settingsBtn:active {
	background-color: #1050A0;
}

.flip #settingsBtn {
	background-color: #6B46C1;
}

.flip #settingsBtn:hover {
	background-color: #553C9A;
}

.flip #settingsBtn:active {
	background-color: #4C1D95;
}
.flip #top.new {
	animation-name: newtopscore;
	animation-duration: 0.8s;
	animation-iteration-count: 3;
	animation-timing-function: ease-in-out;
}

@keyframes newtopscore {
	0% {
		color: inherit;
		transform: scale(1);
		text-shadow: none;
	}
	25% {
		color: #ff6b6b;
		transform: scale(1.3);
		text-shadow: 0 0 10px #ff6b6b;
	}
	50% {
		color: #4ecdc4;
		transform: scale(1.5);
		text-shadow: 0 0 15px #4ecdc4;
	}
	75% {
		color: #45b7d1;
		transform: scale(1.2);
		text-shadow: 0 0 8px #45b7d1;
	}
	100% {
		color: #f9ca24;
		transform: scale(1.1);
		text-shadow: 0 0 5px #f9ca24;
	}
}

.flip #top.new::before {
	content: "🎉";
	position: absolute;
	left: -30px;
	animation: celebrate 2.4s ease-out;
	font-size: 20px;
}

.flip #top.new::after {
	content: "🎉";
	position: absolute;
	right: -30px;
	animation: celebrate 2.4s ease-out 0.3s;
	font-size: 20px;
}

@keyframes celebrate {
	0% {
		opacity: 0;
		transform: scale(0) rotate(0deg);
	}
	20% {
		opacity: 1;
		transform: scale(1.5) rotate(90deg);
	}
	40% {
		transform: scale(1.2) rotate(180deg);
	}
	60% {
		transform: scale(1.3) rotate(270deg);
	}
	80% {
		transform: scale(1.1) rotate(360deg);
	}
	100% {
		opacity: 0;
		transform: scale(0.8) rotate(450deg);
	}
}
.flip .board {
	position: relative;
	background: #ddd;
	box-sizing: none;
	border: 5px solid #ddd;
}
.flip .timer {
	width: 100%;
	height: 22px;
	box-sizing: border-box;
	border: 1px solid #3080D0;
}
.flip #time {
	background-color: #3080D0;
	width: 100%;
	height: 20px;
}

.flip #gameOver {
	width: 100%;
	height: fit-content;
	background: #ddd;
	opacity: 0.8;
	display: none;
	color: #000;
	font-size: 30px;
	font-weight: bold;
	text-align: center;
	margin-top: -212px;
	z-index: 100;
}

.flip #pauseOverlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000000;
	color: #fff;
	font-size: 36px;
	font-weight: bold;
	text-align: center;
	z-index: 1000;
	padding: 20px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	border-radius: 5px;
}

.flip #pauseOverlay.hidden {
	display: none;
}

/* Additional anti-cheat measures when game is paused */
.flip.paused .board {
	filter: blur(20px);
	pointer-events: none;
}

.flip.paused .cell {
	visibility: hidden;
}

.flip #pauseOverlay button {
	background-color: #4CAF50;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 18px;
	font-weight: bold;
	margin-top: 15px;
	transition: background-color 0.2s;
}

.flip #pauseOverlay button:hover {
	background-color: #45a049;
}

.flip #pauseOverlay button:active {
	background-color: #3d8b40;
}

.flip #settingsModal {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1001;
}

.flip #settingsModal.hidden {
	display: none;
}

.flip .settings-content {
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	text-align: center;
	min-width: 300px;
	max-width: 400px;
}

.flip .settings-content h3 {
	margin: 0 0 20px 0;
	color: #333;
	font-size: 24px;
	font-weight: bold;
}

.flip .setting-item {
	margin: 15px 0;
}

.flip .setting-item button {
	background-color: #DC2626;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 16px;
	font-weight: bold;
	transition: background-color 0.2s;
	width: 100%;
}

.flip .setting-item button:hover {
	background-color: #B91C1C;
}

.flip .setting-item button:active {
	background-color: #991B1B;
}

.flip .settings-close {
	margin-top: 25px;
	border-top: 1px solid #e5e5e5;
	padding-top: 15px;
}

.flip .settings-close button {
	background-color: #6B7280;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
	transition: background-color 0.2s;
}

.flip .settings-close button:hover {
	background-color: #4B5563;
}

.flip .settings-close button:active {
	background-color: #374151;
}

.flip .cell {
	position: absolute;
	opacity: 1;
	z-index: 1;
}
.flip .cell.empty {
	display: none;
}
.flip .cell.selected {
	transform: rotate(6deg) scale(1.13);
	z-index: 2;
}

.flip .cell.marked {
	animation-name: destroy;
	animation-duration: 0.30s;
}

.flip .cell.left {
	animation-name: moveleft;
	animation-duration: 0.30s;
}
.flip .cell.right {
	animation-name: moveright;
	animation-duration: 0.30s;
}
.flip .cell.up {
	animation-name: moveup;
	animation-duration: 0.30s;
}
.flip .cell.down {
	animation-name: movedown;
	animation-duration: 0.30s;
}

@keyframes moveleft {
	from { margin-left: 0px; }
	to { margin-left: -40px; transform: rotate(0) scale(1);}
}

@keyframes moveright {
	from { margin-left: 0px; }
	to { margin-left: 40px; transform: rotate(0) scale(1);}
}

@keyframes moveup {
	from { margin-top: 0px; }
	to { margin-top: -40px; transform: rotate(0) scale(1);}
}

@keyframes movedown {
	from { margin-top: 0px; }
	to { margin-top: 40px; }
}

@keyframes destroy {
	0% { opacity: 1; }
	50% { opacity: 0.5; transform: scale(1.2);}
	100% { opacity: 0; transform: scale(1); }
}
.flip .rules {
	margin-bottom: 3em;
}

.flip .rules p {
	margin-bottom: 1em;
	text-indent: 1.4em;
}

.flip h2 {
	line-height: 2em;
	font-size: 130%;
	font-weight: normal;
}
