* {
	box-sizing: border-box;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
	margin: 0;
	background: #0b0b0f;
	color: #fff;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.game-wrapper {
	display: flex;
	flex: 1;
	padding: 1rem;
	gap: 1rem;
	flex-wrap: wrap;
	position: relative;
}

/* DADO 3D EM OVERLAY (centro do ecrã) */

.dice-overlay {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8); 
	opacity: 0;
	z-index: 20;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.dice-overlay.active {
	opacity: 1;
	transform: translate(-50%, -50%) scale(2.4); 
}
/* TABULEIRO ---------------------------------------------------- */

.board {
	flex: 1 1 auto;
	min-width: 320px;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-auto-rows: minmax(70px, 1fr);
	gap: 6px;
	background: radial-gradient(circle at top, #333 0, #111 60%);
	padding: 6px;
	border-radius: 12px;
	border: 2px solid #272738;
}

.tile {
	border-radius: 10px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	overflow: hidden;
}

.tile::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
	opacity: 0.9;
	pointer-events: none;
}

.tile.start {
	background: #424242;
}

.tile.question {
	background: #283593;
}

.tile.finish {
	background: #2e7d32;
}

.tile-index {
	position: absolute;
	top: 4px;
	left: 6px;
	font-size: 1.1rem;
	opacity: 0.85;
	font-weight: 600;
	text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.tile-label {
	position: absolute;
	bottom: 4px;
	right: 6px;
	font-size: 0.8rem;
	opacity: 0.8;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pawn-wrapper {
	position: relative;
	display: flex;
	gap: 6px;
	z-index: 1;
}

.pawn {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.pawn.player-0 {
	background: #ffb300;
}

.pawn.player-1 {
	background: #29b6f6;
}

.tile.current-tile {
	outline: 3px solid #ffffff;
	box-shadow: 0 0 18px rgba(255,255,255,0.9);
	transform: translateY(-2px);
}

.tile.current-tile::before {
	background: radial-gradient(circle at center, rgba(255,255,255,0.25), transparent);
}

.sidebar {
	flex: 0 0 250px;
	min-width: 180px;
	background: #151520;
	border-radius: 12px;
	padding: 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	border: 1px solid #272738;
}

.current-player {
	font-size: 1.2rem;
	font-weight: 600;
}

.dice-display {
	font-size: 2.8rem;
	margin: 0.5rem 0;
	min-height: 3.2rem;
	letter-spacing: 0.1em;
}

.dice-label {
	opacity: 0.8;
}

button {
	padding: 0.6rem 1.1rem;
	font-size: 1rem;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	background: #29b6f6;
	color: #0b0b0f;
	font-weight: 600;
	transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

button:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

button:disabled {
	opacity: 0.4;
	cursor: default;
	box-shadow: none;
	transform: none;
}

#status {
	min-height: 2rem;
	font-size: 0.95rem;
	opacity: 0.95;
}

#positions {
	font-size: 0.9rem;
	line-height: 1.4;
}

/* Modal pergunta */

.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.82);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 50;
}

.modal-backdrop.active {
	display: flex;
}

.modal {
	background: #1e1e2b;
	border-radius: 14px;
	max-width: 650px;
	width: 90%;
	padding: 1.6rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	border: 1px solid #42426a;
	box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.modal h2 {
	margin: 0;
	font-size: 1.1rem;
}

.options {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.options button {
	width: 100%;
	text-align: left;
	background: #25253a;
	color: #fff;
	border-radius: 8px;
	border: 1px solid transparent;
	font-weight: 500;
}

.options button:hover {
	background: #303052;
	border-color: #5555aa;
}

.question-media {
	font-size: 0.85rem;
	opacity: 0.85;
}

/* Overlay de pergunta (80% do ecrã) */

.question-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 60;
}

.question-overlay.active {
	display: flex;
}

.question-frame {
	width: 80vw;
	height: 80vh;
	background: #1b1b26;
	border-radius: 16px;
	border: 1px solid #44446a;
	box-shadow: 0 14px 40px rgba(0,0,0,0.7);
	overflow: auto;
	padding: 1.6rem;
	position: relative;
}

.question-timer {
	position: absolute;
	top: 12px;
	right: 18px;
	font-size: 1.4rem;
	font-weight: 700;
	color: #ff5252;
	text-shadow: 0 0 6px rgba(0,0,0,0.6);
}

/* Conteúdo que vem dos ficheiros de /perguntas pode usar estas classes se quiser */
.question-root {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	color: #fff;
	font-size: 1rem;
}

.question-root h2 {
	margin: 0 0 0.5rem;
	font-size: 1.4rem;
}

.question-media {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.question-media img {
	max-width: 100%;
	border-radius: 8px;
	display: block;
}

.question-options {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.question-options button {
	padding: 0.7rem 1rem;
	border-radius: 8px;
	border: 1px solid #3c3c7a;
	background: #25253a;
	color: #fff;
	font-size: 1rem;
	text-align: left;
	cursor: pointer;
}

.question-options button:hover {
	background: #30305a;
	border-color: #5c5ccc;
}

@media (max-width: 768px) {
	.board {
		grid-auto-rows: minmax(60px, 1fr);
	}

	.tile-index {
		font-size: 1rem;
	}
}