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

body {
	background: #708090;
	color: #ffffff;
	font-family: Helvetica, Arial, sans-serif;
	margin: 0;
	padding: 0;
}

body::before { /* create a visible time line on the page */
	content: "";
	position: fixed;
	top: 0;
	bottom: 0;
	left: calc(50vw - 170px); /* place the line under the date of cards */
	width: 2px; /* Thickness of the line */
	height:100%;
	background:#333344; /* Color of the line */
	z-index: 10; /* Ensure the line is below the cards */
	pointer-events: none; /* Prevent the line from interfering with interactions */
	opacity: 0; /* Initially hidden */
	animation: fadeIn 2.5s 2s forwards; /* 2s delay before fade-in */
}

@keyframes fadeIn {
	0% {
		opacity: 0; /* Hidden */
	}
	100% {
		opacity: 1; /* Fully visible */
	}
}

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

footer {
	position:fixed;
	background: linear-gradient(to top, #708090 80%, rgba(112, 128, 144, 0));
	bottom: 0;
	left: 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 */
}

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

a, .accent {
	color: #333344;
	text-decoration: none;
}

#dateDisplay {
	display: flex;
	color:#ffffff;
	justify-content: center;	
	margin-top: -26px;
	text-transform: capitalize;
	letter-spacing: 1px;
	font-size: 18px;
	font-weight:bold;
}

#subtitle {
	display: flex; /* hiding this for now, change to flex to display */
	color:#ffffff;
	justify-content: center;	
	text-transform: capitalize;
	letter-spacing: 1.4px;
	font-size: 10px;
	text-transform: uppercase;
}

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

/* Events Container */
#eventsContainer {
	display: flex;
	flex-direction: column; /* Stack items vertically */
	justify-content: center; /* Align items from the top down */
	min-height: 100vh; /* Ensure it fills the viewport initially */	
	align-items: center; /* Center the cards horizontally */
	padding: 50px 16px; /* Adjust padding to accommodate header/footer heights */
	gap: 0; /* Uniform spacing between cards */
}

.card {
	position: fixed;
	top: 50vh; /* Start centered vertically */
	left: 50%; /* Start centered horizontally */
	transform: translate(-50%, -50%) rotateY(0deg); /* Initial positioning */
	z-index: 20;
	transition: 
		transform 0.6s ease, 
		width 0.6s ease, 
		height 0.6s ease, 
		box-shadow 0.6s ease,
		margin 0.6s ease,
		opacity 0.6s ease;
	opacity: 1;
	width: 280px;
	height: 150px;
	background-color: #333344;
	border: 2px solid #444;
	border-radius: 8px;
	box-shadow: 0 12px 16px rgba(0, 0, 0, 0.3); /* Outer shadow for depth */
	transform-style: preserve-3d;
	margin:8px 0;
	cursor: pointer;
}

.card.visible {
	opacity: 1;
}

.card.lowering {
	/* Match the final size and position of a placed card */
	margin-left: -78px;
	box-shadow: none; /* Remove the shadow */
	transform: translate(-50%, -50%) rotateY(180deg); /* Maintain flat position */
	height:120px;
	width:224px;
}

.card.placed {
	position: relative; /* Move to the normal document flow */
	transform: rotateY(180deg); /* Flip */
	z-index: 10; /* Reset stacking order */
	top: auto; /* Reset for relative positioning */
	left: -78px; /* shift left to allow the year to be seen */
	transition: box-shadow 0.6s ease, transform 0.6s ease, width 0.6s ease, height 0.6s ease;  /* Smooth animations */
	box-shadow: none;	
	height:120px;
	width:224px;	
	cursor: pointer;
}

/* Front and Back Styling */
.card .front,
.card .back {
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 10px;
}

.card .back {
	transform: rotateY(180deg);
	background-color: #f0f0ff;
	border-radius: 8px;	
}

/* Year Styling */
.card .year {
	display: block;
	font-weight: bold;
	color: white;
	position: absolute;
	margin-left: -181px;
	transform: rotate(270deg) scale(0.8); /* Rotates vertically */
	background-color: #333344;
	padding: 8px 4px;
	text-align: center;
	border-radius: 8px 8px 0 0;
	font-size: 30px;
	width:148px;	
}

/* Description Styling */
.card .description {
	color:#ddd;
	line-height: 1.2;
	text-align: left;
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	padding:0 10px;
	font-size:15px;
	line-height:1.3;
}

.card.placed .description, .card.lowering .description {
	padding-left: 45px; /* Offset for year */
	color:#333;
	font-size:11px;
}

.card.incorrect {
	border:3px solid #f44336;
}

/* probably not going to use this */
.card.corrected {
	transition: all 0.5s ease;
	transform: scale(1.1);
}

.gap {
	margin:0; /* Match the space between cards */
	height:0;
	width: 224px;
	transition: height 0.5s ease; /* Smooth transition */	
	will-change: height; /* Suggest to the browser that the filter property may change */
}

.gap.highlight {
	position: relative;
	height:120px;
	width:224px;
	left:-78px;
	border: 2px dashed rgba(255, 255, 255, 0.4); /* Dashed border for visual effect */
	border-radius: 12px; /* Rounded corners */
	box-sizing: border-box; /* Ensures padding and borders are included in the height/width */
	display: flex;
	align-items: center;
	justify-content: center;
	margin:8px 0;
	background:#708090CC;
	z-index:15;
}

.gap.highlight::after {
	content: attr(data-text);
	transform: rotate(-90deg);
	font-size: 14px;
	letter-spacing: 1px;
	white-space: nowrap;
	position: absolute;
	margin-left:-184px;
	opacity: 0;
	color:rgba(204, 204, 204, 0.9);
	animation: fadeIn 0.5s ease-in forwards;
}

#feedbackFooter {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px;
}

/* Feedback Squares */
#feedbackRow {
  display: flex;
  gap: 8px; /* Space between squares */
  margin: 0 auto; /* Center vertically and add spacing */
}

.feedback-square {
	width: 20px;
	height: 20px;
	background-color: #708090; /* Default color for unused squares */
	border-radius: 4px;
	border: 1px solid #333344;
}

/* Green for correct placement */
.feedback-square.correct {
	background-color: #4caf50;
}

/* Red for incorrect placement */
.feedback-square.incorrect {
	background-color: #f44336;
}

/* Hidden elements */
.hidden {
	display: none !important;
}

/* Share Link Styling */
#shareLink {
	text-decoration: none;
	color: #007bff;
	font-size: 14px;
}

/* Pop-Up Modal */
#popup {
	position: fixed;
top: 50vh; /* Start centered vertically */
left: 50%; /* Start centered horizontally */
transform: translate(-50%, -50%) rotateY(0deg); /* Initial positioning */
z-index: 20;
transition:
	transform 0.6s ease,
	width 0.6s ease,
	box-shadow 0.6s ease,
	margin 0.6s ease,
	opacity 0.6s ease;
opacity: 1;
min-width: 280px;
background-color: #f0f0ff;
border: 2px solid #444;
border-radius: 8px;
box-shadow: 0 12px 16px rgba(0, 0, 0, 0.3); /* Outer shadow for depth */
transform-style: preserve-3d;
padding: 20px;
}

#popup .popup-content {
	text-align: center;
}

#popup .popup-content p {
	color:#333;
	font-size:15px;
}

#popup h2 {
	margin-top: 15px;
	color: #333344;
}

/* User's Score Section - Prominent (matches WikiLetters) */
#popup-score-section {
	margin: 12px 0 20px 0;
}

#popup-score-label {
	color: #888;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin-bottom: 6px;
}

#popup-score-value {
	color: #333344;
	font-size: 36px;
	font-weight: bold;
	margin: 3px 0;
}

/* Average Score Section - Secondary */
#average-score-section {
	margin: 0 0 15px 0;
}

.average-score-text {
	color: #888;
	font-size: 13px;
	margin: 0;
}

.average-score-text strong {
	color: #555;
	font-size: 14px;
	font-weight: normal;
}

#popup .popup-actions {
	margin-top: 20px;
	display: flex;
	justify-content: center;
	gap: 10px;
}

#popup a {
	background-color: #333344;
	color: #fff;
	border: none;
	padding: 5px 10px;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	font-size:14px;
}

#popup a:hover {
	background-color: #222233;
}

#popup #closePopup {
	position: absolute;
	top: 0px;
	right: 0px;
	background-color: transparent;
	color: #333344;
	border: none;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
}

#shareIcon {
    background-color: #333344;
    padding: 4px;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
    opacity: 0.8;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
	position:absolute;
	margin-left:-30px;
	margin-top:-2px;
}

#shareIcon:hover {
    opacity: 1;
    transform: scale(1.1);
}

#shareIcon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Pop animation for feedback squares and cards */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes popCard {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}

.card.pop {
	animation: popCard 0.8s ease both;
}

.feedback-square.pop {
	animation: pop 0.8s ease both;
}

/* Add shake animation for invalid placement */
.card.cannot-place {
    animation: shake 0.5s ease both;
}

@keyframes shake {
    10%, 90% { transform: translate(-50%, -50%) rotateY(0deg) translateX(-1px); }
    20%, 80% { transform: translate(-50%, -50%) rotateY(0deg) translateX(2px); }
    30%, 50%, 70% { transform: translate(-50%, -50%) rotateY(0deg) translateX(-4px); }
    40%, 60% { transform: translate(-50%, -50%) rotateY(0deg) translateX(4px); }
}

/* Game Navigation Tabs */
.game-tabs {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #d8d8e8;
    gap: 0;
    background: transparent;
}

.game-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    text-decoration: none;
    color: #6b6b88 !important;
    background: #fafafe !important;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #d8d8e8;
    border-right: none;
}

.game-tab:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.game-tab:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: 1px solid #d8d8e8;
}

.game-tab-active {
    background: #e8e8f8 !important;
    color: #4a4a77 !important;
    font-weight: 600;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    cursor: default;
}

.game-tab:not(.game-tab-active):hover {
    background: #f0f0fa;
    transform: translateY(-1px);
}

.tab-emoji {
    font-size: 20px;
    margin-bottom: 4px;
}

.tab-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}