:root {
    --color: #5e17eb;
    --bg-primary: #f0f0f0;
    --bg-secondary: #fff;
    --text-primary: #333;
    --text-secondary: #555;
    --border-color: #212121;
    --button-primary: #5e17eb;
    --button-hover: #330989;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-bg: linear-gradient(135deg, #f9f9f9, #e0e0e0);
    --dot-red: #ff1616;
    --dot-blue: #1717e9;
    --dot-yellow: #ffff44;
    --dot-green: #247c04;
    --dot-purple: #884288;
    --dot-orange: #ff8800;
    --dot-cyan: #00cccc;
    --dot-magenta: #f885f8;
    --dot-lime: #3fff3f;
    --dot-teal: #085555;
    --dot-pink: #f3cad1;
    --dot-brown: #681515;
}

.dark-theme {
    --bg-primary: #1e1e21;
    --bg-secondary: #2b2a2d;
    --text-primary: #ffffff;
    --text-secondary: #d0cbcb;
    --border-color: #ffffff;
    --modal-bg: linear-gradient(135deg, #2d2d2d, #1a1a1a);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: Tahoma, Verdana, Segoe, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	background-color: var(--bg-primary);
    color: var(--text-primary);
}

a {
	color: var(--text-primary);
	text-decoration: none;
}

button {
	cursor: pointer;
	border: none;
}

h2, h3, h4 {
	margin: 1rem 0;
}

header {
	width: 100%;
	padding: 2rem 0 1rem 0;
	text-align: center;
}

header h1 {
	font-size: 2.1rem;
}

.color {
	color: var(--color);
}

main {
	width: 100%;
	max-width: 32rem;
	margin: .5rem auto;
}

.game-container {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.game-container .header {
	display: flex;
	justify-content: space-between;
	width: 100%;
	margin-bottom: 0.8rem;
	padding: .5rem;
	font-size: 1.3rem;
	font-weight: bold;
}

.game-container .game-board {
	position: relative;
	width: 100%;
	max-width: 31rem;
	aspect-ratio: 1;
	background-color: var(--bg-secondary);
	border: 0.2rem solid var(--border-color);
	border-radius: 0.6rem;
	overflow: hidden;
	touch-action: none;
	margin-bottom: 1rem;
}

.dot {
	position: absolute;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.3);
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
	z-index: 2;
}

.dot:hover {
	transform: translate(-50%, -50%) scale(1.1);
	box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
}

.dot.selected {
	border: 0.1rem solid white;
	box-shadow: 0 0 0.6rem white, 0 0 1.25rem rgba(255, 255, 255, 0.5);
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0% { box-shadow: 0 0 0.6rem white, 0 0 1.25rem rgba(255, 255, 255, 0.5); }
	50% { box-shadow: 0 0 0.9rem white, 0 0 1.9rem rgba(255, 255, 255, 0.7); }
	100% { box-shadow: 0 0 0.6rem white, 0 0 1.25rem rgba(255, 255, 255, 0.5); }
}

/* Definição das cores dos dots */
.red { background-color: var(--dot-red); }
.blue { background-color: var(--dot-blue); }
.yellow { background-color: var(--dot-yellow); }
.green { background-color: var(--dot-green); }
.purple { background-color: var(--dot-purple); }
.orange { background-color: var(--dot-orange); }
.cyan { background-color: var(--dot-cyan); }
.magenta { background-color: var(--dot-magenta); }
.lime { background-color: var(--dot-lime); }
.teal { background-color: var(--dot-teal); }
.pink { background-color: var(--dot-pink); }
.brown { background-color: var(--dot-brown); }

.drawn-line {
	fill: none;
	stroke-width: 2rem;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: 0.5;
	animation: lineAppear 0.4s ease-in-out;
	shape-rendering: crispEdges;
}

@keyframes lineAppear {
	from { opacity: 0; }
	to { opacity: 0.5; }
}

/* Botões */
.button {
	background-color: var(--button-primary);
	border: none;
	color: white;
	padding: 0.7rem 1.5rem;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	font-size: 1.2rem;
	margin: 0.6rem 0.4rem;
	cursor: pointer;
	border-radius: 0.4rem;
	font-weight: bold;
	transition: background-color 0.3s ease, transform 0.1s ease;
	position: relative;
	overflow: hidden;
}

.button:hover { background-color: var(--button-hover); }

.button:active { transform: scale(0.95); }

.button::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.4rem;
	height: 0.4rem;
	background: rgba(255, 255, 255, 0.5);
	opacity: 0;
	border-radius: 100%;
	transform: scale(1) translate(-50%);
	transform-origin: 50% 50%;
}

.button:focus:not(:active)::after { animation: ripple 1s ease-out; }

@keyframes ripple {
	0% { transform: scale(0); opacity: 0.5; }
	100% { transform: scale(20); opacity: 0; }
}

.level-indicator {
	font-size: 1.3rem;
	margin: 0.6rem 0;
	position: relative;
	padding: 0.4rem 0.9rem;
	background-color: var(--bg-secondary);
	color: var(--text-primary);
	border-radius: 1.25rem;
	box-shadow: 0 0.2rem 0.4rem rgba(0,0,0,0.1);
	transition: transform 0.3s ease;
}

.level-up { animation: levelUp 0.5s ease; }

@keyframes levelUp {
	0% { transform: scale(1); }
	50% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

.time-warning { animation: timeWarning 1s infinite; color: red; }

@keyframes timeWarning {
	0% { opacity: 1; }
	50% { opacity: 0.5; }
	100% { opacity: 1; }
}

.score-increase { animation: scoreIncrease 0.5s ease; }

@keyframes scoreIncrease {
	0% { transform: scale(1); color: #000; }
	50% { transform: scale(1.2); color: #4CAF50; }
	100% { transform: scale(1); color: #000; }
}

/* Estilos dos modais com design melhorado */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--modal-overlay);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 100;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.modal.active {
	opacity: 1;
	pointer-events: all;
}

.modal-content {
	background: var(--modal-bg);
	padding: 1.9rem;
	border-radius: 0.9rem;
	text-align: center;
	max-width: 90%;
	transform: scale(0.8);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
	font-family: Arial, sans-serif;
}

.modal.active .modal-content {
	transform: scale(1);
}

.modal-content h2 {
	margin-bottom: 0.9rem;
	font-size: 1.75rem;
	color: var(--text-primary);
}

.modal-content p {
	margin-bottom: 1.25rem;
	font-size: 1.2rem;
	color: var(--text-secondary);
}

.ads {
	width: 80%;
	max-width: 32rem;
	text-align: center;
	padding: 1rem 0;
}
.ads img {
	width: 100%;
}

article {
	width: 80%;
	max-width: 52rem;
	margin: 1rem auto;
	padding: 1rem;
	text-align: justify;
	font-size: 1.1rem;
	color: var(--text-secondary);
	line-height: 1.6;
}

.return-game {
	padding: 1rem 0;
	text-align: center;
}

.return-game a {
	width: 100%;
	max-width: 30rem;
	margin: 0 auto;
	font-weight: bold;
	background-color: var(--color);
	color: #fff;
	padding: 0.7rem 1.5rem;
	border-radius: 0.4rem;
	text-decoration: none;
	display: block;
	transition: background-color 0.3s ease;
}

footer {
	width: 100%;
	margin: .5rem auto;
	padding: 1rem;
	text-align: center;
	font-size: .9rem;
	color: var(--text-secondary);
}

nav {
	color: var(--text-secondary);
	width: 100%;
	text-align: center;
	padding: 1rem 0;
	font-size: .8rem;
}

nav a,
nav .theme-toggle {
	color: var(--text-secondary);
	padding: .5rem;
	background-color: transparent;
}
