/* !---------- Modal Base ---------- */
.modal {
	position: fixed;
	inset: 0;
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 50;

	background: rgba(0, 0, 0, 0.5); /* dim background */
	backdrop-filter: blur(2px); /* subtle blur */
}

.modal.show {
	display: flex;
}

/* !---------- Modal Content ---------- */
.modal-content {
	width: 50%;
	max-width: 700px;
	background: var(--bg-primary);
	padding: 2em;
	border-radius: 12px;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

	animation: modal-pop 0.2s ease-out;
}

/* Pop animation */
@keyframes modal-pop {
	from {
		transform: scale(0.95);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

/* !---------- Buttons ---------- */
.button {
	padding: 12px 24px;
	border-radius: 8px;
	border: none;
	font-size: 1rem;
	cursor: pointer;
	transition: 0.2s ease;
	margin: 0.4rem;
}

.btn-classic {
	background: #6b7280;
	color: white;
}
.btn-classic:hover {
	opacity: 0.85;
}

.btn-elemental {
	background: #60a5fa;
	color: white;
}
.btn-elemental:hover {
	opacity: 0.85;
}

.btn-cancel {
	background: #ef4444;
	color: white;
}
.btn-cancel:hover {
	opacity: 0.85;
}

/* !---------- Rules Content ---------- */
.rules-text {
	max-height: 60vh;
	overflow-y: auto;
	font-size: 1rem;
	line-height: 1.5;
	padding-right: 4px; /* keeps scrollbar from overlapping text */
}

/* Table styling */
.rules-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0;
}

.rules-table th,
.rules-table td {
	border: 1px solid var(--bg-secondary);
	padding: 8px 10px;
	text-align: left;
}

.rules-table th {
	background: var(--bg-secondary);
	font-weight: bold;
}

/* Remove bullets globally inside rules modal text */
.rules-text ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* !---------- Checkmate Content ---------- */

#winnerName {
	text-transform: capitalize;
}
