:root {
	/* Updated colors to match WikiDates */
	--wiki: #708090; 
	--wikiborder: #444444;
	--wikiborderRight: #333344;
	--wikiborderSelected: #ffffff;
	--text: #ffffff;
	--lighttext: #eee;
	--alert: #f44336;
	--link: #333344; 
	--tile: #333344; 
	--close: #3a6791;
	--closeborder: #0084ff;
	--correct: #0084ff; 
}

* {
	box-sizing: border-box; /* Consistent box model like WikiDates */
}

.FirstArticle {
	font-size:130%;
}

.SecondArticle, .ThirdArticle {
	display:none;
}

.Advanced .SecondArticle, .Advanced .ThirdArticle {
	display:block;
	margin:13px 0 0 0;
}

.Advanced .FirstArticle {
	font-size:100%;
}

body {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 16px;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	height: 100vh;
	background: var(--wiki);
	color: var(--text);
}

header {
	position: relative;
	background: linear-gradient(to bottom, var(--wiki) 80%, rgba(112, 128, 144, 0));
	width: 100%;
	z-index: 1000; /* Ensure it's above scrolling content */
	padding-bottom: 0; /* Add space for the gradient to fade */
}

footer {
	position: relative;
	background: linear-gradient(to top, var(--wiki) 80%, rgba(112, 128, 144, 0));
	width: 100%;
	z-index: 1000; /* Ensure it's above scrolling content */
	text-align: center;
	font-size: 12px;
	padding-top: 20px; /* Add space for the gradient to fade */
	margin-top: auto; /* Push to bottom */
}

h1 {
	margin: 0;
	font-size: 18px;
	padding: 5px;
}

.accent {
	color: var(--link);
}

.score {
	position: absolute;
	top: 5px;
	right: 10px;
	font-weight: bold;
	font-size: 18px;
	color: var(--text);
}

#status {
	font-size: 13px;
	text-align: center;
	margin-top: 4px;
	margin-bottom: 4px;
	height: 40px;
	color: #ccc;
}

#status strong {
	color: #fff;
}

a {
	color: var(--link);
	text-decoration: none;
}

.game-container a {
	color: var(--link);
	display: inline;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: rgba(51, 51, 68, 0.3);
}

main {
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-grow: 1;
}

.game-wrapper {
	position: relative;
	margin: 20px auto;
}

.game-container {
	display: grid;
	grid-template-columns: 20px 188px 188px;
	grid-template-rows: 20px repeat(4, 140px);
	gap: 8px;
	transition: filter 0.5s ease;
	/* This will smoothly transition the filter property */
}

/* New media query for smaller screens like iPhone Pro */
@media only screen and (max-width: 400px) {
	.game-container {
		grid-template-columns: 15px 150px 150px;
		grid-template-rows: 15px repeat(4, 120px);
		gap: 4px;
	}

	.word {
		font-size: 16px;
	}

	.small {
		font-size: 10px;
	}

	.input-container {
		font-size: 14px;
	}

	#status {
		font-size: 12px;
	}
}

/* Loading Effects */
.blur-effect {
	filter: blur(5px);
	pointer-events: none;
	/* Prevent any interactions while loading */
}

.spinner-container {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	/* Center the spinner */
	z-index: 1000;
}

.spinner {
	border: 8px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top: 8px solid #FFF;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* end Loading Effects */

.word {
	font-size: 18px;
	white-space: nowrap;
	font-weight: bold;
}

#row1word,
#row2word,
#row3word,
#row4word {
	align-self: center;
	transform: rotate(-90deg);
}

/* larger text for wide desktop */
@media only screen and (min-width: 769px) {
	body {
		font-size: 19px;
	}

	.game-container {
		grid-template-columns: 20px 220px 220px;
		grid-template-rows: 20px repeat(4, 160px);
	}

	#row1word,
	#row2word,
	#row3word,
	#row4word {
		transform: none;
		text-align: right;
		padding-right: 8px;
		justify-content: flex-end;
	}
}

.small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	height: 20px;
	font-size: 11px;
}

div {
	display: flex;
	justify-content: center;
}

.input-container {
	display: flex;
	background: var(--tile);
	color: var(--lighttext);
	border: 3px solid var(--wikiborder);
	border-radius: 8px; /* Rounded corners like WikiDates cards */
	border-style: solid;
	flex-direction: column;
	box-sizing: border-box;
	padding: 3px;
	text-align: center;
	transition: transform 0.3s ease-in-out;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow like WikiDates cards */
}

.selected {
	border-color: var(--wikiborderSelected) !important;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Enhanced shadow when selected */
}

.RightRowRightCol.swapped {
	border-color: var(--correct);
	border-style: solid;
	background: var(--correct);
}

.WrongRowRightCol.swapped {
	border-left-color: var(--closeborder);
	border-left-style: solid;
	border-right-color: var(--closeborder);
	border-right-style: solid;
	border-top-color: var(--close);
	border-top-style: solid;
	border-bottom-color: var(--close);
	border-bottom-style: solid;
	background: var(--close);
	color: #ffffff;
}

.RightRowWrongCol.swapped {
	border-top-color: var(--closeborder);
	border-top-style: solid;
	border-bottom-color: var(--closeborder);
	border-bottom-style: solid;
	border-left-color: var(--close);
	border-left-style: solid;
	border-right-color: var(--close);
	border-right-style: solid;

	background: var(--close);
	color: #ffffff;
}

#gameOptions {
	display: flex;
	color: #ffffff;
	justify-content: center;
	margin-top: -26px;
	letter-spacing: 1px;
	font-size: 18px;
	align-items: center; /* Ensure vertical alignment */
}

#gameOptions a {
	text-transform: none;
	font-weight: normal;
	text-align: right;
	color: var(--text);
	text-decoration: none;
	transition: color 0.2s;
	line-height: 1; /* Consistent line height */
}

#gameOptions a:hover {
	color: var(--link);
}

#gameOptions strong {
	font-weight: bold;
	text-transform: none;
	line-height: 1; /* Consistent line height */
}

.gameSettings {
	display: flex;
	justify-content: center;
	margin: 10px 0;
	font-size: 13px;
}

#oneClue {
	font-weight: bold;
}

.Advanced #oneClue {
	font-weight: normal;
}

.Advanced #threeClues {
	font-weight: bold;
}

#playRandomWikitile {
	font-weight: normal;
}

.Today #playRandomWikitile {
	font-weight: normal;
}

.hidden {
	display: none !important;
}

#shareLink {
	color: var(--link);
	cursor: pointer;
	font-size: 12px;
}

/* Popup styling similar to WikiDates */
#popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
}

#popup.hidden {
	display: none;
}

#popup .popup-content {
	background-color: var(--wiki);
	padding: 20px;
	border-radius: 8px;
	max-width: 80%;
	text-align: center;
	position: relative;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#popup .popup-content p {
	margin: 15px 0;
	color: var(--text);
}

#popup h2 {
	margin-top: 0;
	color: var(--text);
}

#popup .popup-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 20px;
}

#popup a {
	background-color: var(--tile);
	color: white;
	padding: 8px 16px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: bold;
	transition: background-color 0.3s;
}

#popup a:hover {
	background-color: var(--link);
}

#popup #closePopup {
	position: absolute;
	top: 10px;
	right: 10px;
	background: none;
	border: none;
	font-size: 24px;
	color: var(--text);
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

/* Share icon styling similar to WikiDates */
#shareIcon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background-color: var(--tile);
	border-radius: 50%;
	margin-left: 10px;
	cursor: pointer;
	transition: background-color 0.3s;
}

#shareIcon:hover {
	background-color: var(--link);
}

#shareIcon svg {
	width: 18px;
	height: 18px;
}

#subtitle {
	display: flex;
	color: #ffffff;
	justify-content: center;
	text-transform: capitalize;
	letter-spacing: 1.4px;
	font-size: 10px;
	text-transform: uppercase;
}
	