:root {
	--bg-color: #0d0b1a;
	--primary-color: #9969ff;
	--secondary-color: #ff69a1;
	--text-color: #ffffff;
	--card-back: linear-gradient(45deg, #4a0e77, #650d6d);
	--card-front: linear-gradient(135deg, #2b2f66, #1c1647);
	--card-hover: #764ba2;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Cormorant Garamond", serif;
	background-color: var(--bg-color);
	background-image: radial-gradient(circle, #1a1333 0%, #0d0b1a 100%);
	color: var(--text-color);
	min-height: 100vh;
	overflow-x: hidden;
}

.container {
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
	position: relative;
}

header {
	text-align: center;
	margin-bottom: 3rem;
	position: relative;
	z-index: 2;
}

h1 {
	font-family: "Cinzel", serif;
	font-size: 3rem;
	margin-bottom: 0.5rem;
	background: linear-gradient(
		to right,
		var(--primary-color),
		var(--secondary-color)
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 0 10px rgba(153, 105, 255, 0.3);
}

.subtitle {
	font-size: 1.2rem;
	opacity: 0.8;
	max-width: 600px;
	margin: 0 auto;
}

.card-table {
	perspective: 1000px;
	margin-bottom: 2rem;
	min-height: 400px;
	z-index: 2;
	position: relative;
}

.cards-container {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1.5rem;
	min-height: 350px;
	padding: 1rem;
}

.card {
	width: 160px;
	height: 280px;
	position: relative;
	transform-style: preserve-3d;
	transition: transform 1s, filter 0.5s;
	cursor: pointer;
	filter: brightness(0.9);
}

.card:hover {
	filter: brightness(1.2) drop-shadow(0 0 15px rgba(153, 105, 255, 0.6));
	transform: translateY(-15px) rotateY(10deg);
}

.card-face {
	width: 100%;
	height: 100%;
	position: absolute;
	backface-visibility: hidden;
	border-radius: 15px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.card-back {
	background: var(--card-back);
	border: 3px solid rgba(255, 255, 255, 0.1);
}

.card-front {
	background: var(--card-front);
	transform: rotateY(180deg);
	padding: 1rem;
	text-align: center;
	border: 3px solid rgba(153, 105, 255, 0.3);
}

.card-symbol {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.9;
}

.card-title {
	font-family: "Cinzel", serif;
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
	background: linear-gradient(
		to right,
		var(--primary-color),
		var(--secondary-color)
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.card-desc {
	font-size: 0.9rem;
	opacity: 0.7;
}

.card.flipped {
	transform: rotateY(180deg);
	pointer-events: none;
}

.card-back:before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80%;
	height: 80%;
	background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z' fill='rgba(255, 255, 255, 0.2)'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.5;
}

.card-back:after {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: repeating-linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.05) 0,
		rgba(255, 255, 255, 0.05) 1px,
		transparent 1px,
		transparent 10px
	);
	border-radius: 15px;
}

.message-container {
	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;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s;
	z-index: 10;
}

.message-container.visible {
	opacity: 1;
	pointer-events: all;
}

.message-card {
	width: 90%;
	max-width: 500px;
	background: rgba(30, 25, 50, 0.95);
	backdrop-filter: blur(10px);
	padding: 3rem;
	border-radius: 20px;
	border: 1px solid rgba(153, 105, 255, 0.3);
	text-align: center;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
	transform: translateY(30px);
	opacity: 0;
	transition: transform 0.8s, opacity 0.8s;
}

.message-container.visible .message-card {
	transform: translateY(0);
	opacity: 1;
}

.message-title {
	font-family: "Cinzel", serif;
	font-size: 2.2rem;
	margin-bottom: 1.5rem;
	background: linear-gradient(
		to right,
		var(--primary-color),
		var(--secondary-color)
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.message-text {
	font-size: 1.6rem;
	line-height: 1.6;
	margin-bottom: 2rem;
}

button {
	background: linear-gradient(
		45deg,
		var(--primary-color),
		var(--secondary-color)
	);
	color: white;
	border: none;
	padding: 0.8rem 2rem;
	font-family: "Cinzel", serif;
	font-size: 1rem;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s;
	box-shadow: 0 5px 15px rgba(153, 105, 255, 0.4);
}

button:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(153, 105, 255, 0.6);
}

footer {
	text-align: center;
	margin-top: 3rem;
	opacity: 0.5;
	font-size: 0.9rem;
}

canvas {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
}

@media (max-width: 768px) {
	h1 {
		font-size: 2rem;
	}

	.card {
		width: 130px;
		height: 230px;
	}

	.card-symbol {
		font-size: 2.5rem;
	}

	.message-card {
		padding: 2rem;
	}

	.message-title {
		font-size: 1.8rem;
	}

	.message-text {
		font-size: 1.3rem;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 1rem;
	}

	h1 {
		font-size: 1.8rem;
	}

	.cards-container {
		gap: 1rem;
	}

	.card {
		width: 110px;
		height: 190px;
	}

	.card-symbol {
		font-size: 2rem;
	}

	.card-title {
		font-size: 1rem;
	}

	.card-desc {
		font-size: 0.8rem;
	}
}

/* Special Animation Elements */
.magical-sparkle {
	position: absolute;
	width: 5px;
	height: 5px;
	background: white;
	border-radius: 50%;
	pointer-events: none;
	z-index: 100;
	animation: sparkle 1s forwards;
}

@keyframes sparkle {
	0% {
		transform: scale(0) rotate(0deg);
		opacity: 1;
	}
	100% {
		transform: scale(1.5) rotate(90deg);
		opacity: 0;
	}
}