.samegame .tile,
.samegame .tile0,
.samegame .tile1,
.samegame .tile2,
.samegame .tile3 {
	width: 19px;
	height: 19px;
}

.samegame .body {
	padding: 0 10px;
	max-width: 100%;
	overflow-x: auto;
}

.samegame #arena {
	width: 400px;
	height: 300px;
	margin: 20px auto;
	position: relative;
	border: 1px solid #3080D0;
	max-width: 90vw;
	max-height: 70vh;
}

/* Responsive container */
.samegame .game-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

@media (min-width: 768px) {
	.samegame .game-container {
		flex-direction: row;
		justify-content: center;
		align-items: flex-start;
		gap: 20px;
	}
}

.samegame .tile {
	position: absolute;
	border-bottom: 1px solid #fff;
	border-right: 1px solid #fff;
	z-index: 1;
	min-width: 8px;
	min-height: 8px;
	background-size: contain;
	background-repeat: no-repeat;
}

/* Dark mode support for tiles - remove white borders */
body.dark .samegame .tile {
	border-bottom: 1px solid #4a5568;
	border-right: 1px solid #4a5568;
}

.samegame #end {
	position: absolute;
	z-index: 10000;
	display: none;
	cursor: default;
	color: #000000;
	font-weight: 900;
	font-size: 18px;
}



.samegame #infoBox {
	position: absolute;
	top: -40px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 1px solid #dee2e6;
	border-radius: 8px 8px 0 0;
	padding: 8px 12px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	font-size: 15px;
	font-weight: 500;
}

/* Dark mode support for infoBox */
body.dark .samegame #infoBox {
	background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
	border: 1px solid #4a5568;
	box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@media (max-width: 480px) {
	.samegame #infoBox {
		font-size: 12px;
		top: -32px;
		padding: 6px 10px;
	}
}

.samegame #scoreLabel,
.samegame #topScoreLabel {
	color: #6c757d;
	margin-right: 4px;
}

/* Dark mode support for score labels */
body.dark .samegame #scoreLabel,
body.dark .samegame #topScoreLabel {
	color: #a0aec0;
}

.samegame #score,
.samegame #topScore {
	font-weight: 700;
	color: #3080D0;
	font-size: 16px;
}

/* Dark mode support for score values */
body.dark .samegame #score,
body.dark .samegame #topScore {
	color: #63b3ed;
}

@media (max-width: 480px) {
	.samegame #score,
	.samegame #topScore {
		font-size: 14px;
	}
}


/* Touch-friendly improvements */
@media (hover: none) {
	.samegame .tile {
		cursor: pointer;
	}
	
	.samegame .tile:active {
		transform: scale(0.95);
		transition: transform 0.1s ease;
	}
}

/* Responsive game info */
.samegame .info {
	text-align: center;
	margin-bottom: 20px;
	font-size: 16px;
	line-height: 1.5;
	color: #495057;

	padding: 15px;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

/* Dark mode support for game info */
body.dark .samegame .info {
	color: #e2e8f0;
}

@media (max-width: 480px) {
	.samegame .info {
		font-size: 13px;
		margin-bottom: 15px;
		padding: 12px;
	}
}

/* Popup overlay styles */
#overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1001;
}

#popup {
	background-color: white;
	padding: 20px;
	border-radius: 10px;
	text-align: center;
	color: black;
	max-width: 400px;
	width: 90%;
}

#popup h2 {
	margin: 0 0 10px 0;
	color: #3080D0;
}

#popup p {
	margin: 10px 0;
}

.game-button {
	background-color: #3080D0;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
	margin: 5px;
}

.game-button:hover {
	background-color: #2563a8;
}

.game-button:active {
	transform: scale(0.98);
}
