:root {
	--bg: #0b0c10;
	--card: #111218;
	--muted: #b3b7c0;
	--text: #e8ecf1;
	--brand: #7c5cff; /* X color */
	--brand-2: #00d4ff; /* O color */
	--ring: rgba(124, 92, 255, 0.45);
	--border-color: rgba(255, 255, 255, 0.12);
}

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

html {
	scroll-behavior: smooth;
}

body {
	color: var(--text);
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
		Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: radial-gradient(
			900px 520px at 70% -10%,
			rgba(124, 92, 255, 0.12),
			transparent 60%
		),
		var(--bg);

	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 20px;
}

.game-container {
	position: relative;
	text-align: center;
}

.title {
	font-size: 2.5rem;
	color: var(--brand);
	margin-bottom: 8px;
}

.turn-indicator {
	font-size: 1rem;
	color: var(--muted);
	margin-bottom: 24px;
	height: 1.2rem;
}

.board {
	display: grid;
	grid-template-columns: repeat(3, 1fr);

	width: min(90vw, 450px);
	height: min(90vw, 450px);

	background: var(--card);
	border-radius: 16px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	border: 1px solid var(--border-color);
}

.cell {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;

	font-size: clamp(3rem, 20vw, 6rem);
	font-weight: 800;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cell:hover {
	background: rgba(255, 255, 255, 0.05);
}

.cell:not(:nth-child(3n)) {
	border-right: 4px solid var(--muted);
}
.cell:not(:nth-child(n + 7)) {
	border-bottom: 4px solid var(--muted);
}

.cell.x {
	color: var(--brand);
}
.cell.o {
	color: var(--brand-2);
}

.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(11, 12, 16, 0.9);
	display: grid;
	place-items: center;
	z-index: 100;
	opacity: 1;
	pointer-events: auto;
	transition: opacity 0.3s ease;
	padding: 20px;
}

.modal.hidden {
	opacity: 0;
	pointer-events: none;
}

.modal-content {
	background: var(--card);
	padding: 32px 40px;
	border-radius: 16px;
	text-align: center;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
	border: 1px solid var(--border-color);

	width: 100%;
	max-width: 400px;
}

.modal-content h2 {
	margin-bottom: 24px;
	font-size: 1.5rem;
	color: var(--text);
}

.choice-buttons {
	display: flex;
	gap: 16px;
	justify-content: center;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #0e0e0e;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 12px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: box-shadow 0.15s ease;
}

.btn:hover {
	box-shadow: 0 0 0 6px var(--ring);
}

.choice-btn {
	width: 90px;
	height: 90px;
	font-size: 3.5rem;
	font-weight: 800;
}
.choice-btn.x {
	color: var(--brand);
}
.choice-btn.o {
	color: var(--brand-2);
}

@media (max-width: 320px) {
	.modal-content {
		padding: 24px 16px;
	}
	.choice-buttons {
		gap: 10px;
	}
	.choice-btn {
		width: 80px;
		height: 80px;
		font-size: 3rem;
	}
}
