.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;
	gap: 20px;
	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 */
#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);
}

/* Settings button */
.samegame .settings-btn {
	cursor: pointer;
	padding: 4px 8px;
	border: 1px solid #dee2e6;
	background: #fff;
	border-radius: 4px;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #495057;
	transition: background-color 0.2s, border-color 0.2s;
	margin-left: auto;
}

.samegame .settings-btn:hover {
	background: #f8f9fa;
	border-color: #adb5bd;
}

body.dark .samegame .settings-btn {
	background: #2d3748;
	border-color: #4a5568;
	color: #e2e8f0;
}

body.dark .samegame .settings-btn:hover {
	background: #374151;
	border-color: #6b7280;
}

/* Settings modal */
.samegame #settingsModal {
	position: fixed;
	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;
}

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

.samegame .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;
}

body.dark .samegame .settings-content {
	background: #2a2a2a;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

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

body.dark .samegame .settings-content h3 {
	color: #68A5FF;
}

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

.samegame .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%;
}

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

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

body.dark .samegame .setting-item button {
	background-color: #DC2626;
}

body.dark .samegame .setting-item button:hover {
	background-color: #B91C1C;
}

body.dark .samegame .setting-item button:active {
	background-color: #991B1B;
}

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

body.dark .samegame .settings-close {
	border-top-color: #444;
}

.samegame .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;
}

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

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

body.dark .samegame .settings-close button {
	background-color: #555;
}

body.dark .samegame .settings-close button:hover {
	background-color: #666;
}

body.dark .samegame .settings-close button:active {
	background-color: #444;
}
