/**
 * ALFABETO COM SOM V2 - Jogo Educativo Moderno
 * Design responsivo mobile-first
 * Data: 20/01/2026
 */

/* ===================================
   VARIÁVEIS E RESET
   =================================== */

:root {
	--primary-color: #5e4fa2;
	--secondary-color: #fd9c00;
	--success-color: #4caf50;
	--error-color: #f44336;
	--bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--card-shadow: 0 4px 20px rgba(0,0,0,0.1);
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

body {
	font-family: 'Fredoka', sans-serif;
	background: #f5f7fa;
	min-height: 100vh;
}

/* ===================================
   LAYOUT WRAPPER
   =================================== */

.game-wrapper {
	padding: 20px 0 40px;
	min-height: calc(100vh - 200px);
}

h1 {
	color: var(--primary-color);
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 20px 0;
	text-align: center;
}

/* ===================================
   SOCIAL SHARE
   =================================== */

.social-share {
	text-align: center;
	margin: 15px 0;
}

/* ===================================
   ANÚNCIOS - DESKTOP/TABLET
   =================================== */

.ad-container {
	margin: 20px 0;
	text-align: center;
	min-height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ad-top {
	margin-bottom: 25px;
}

.ad-middle {
	margin-top: 30px;
	margin-bottom: 30px;
}

/* Esconde ads em mobile (regra global em mobile-fixes.css) */

/* ===================================
   CONTAINER DO JOGO
   =================================== */

.game-container {
	background: white;
	border-radius: 20px;
	box-shadow: var(--card-shadow);
	overflow: hidden;
	position: relative;
}

.game-header {
	background: var(--bg-gradient);
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.level-info {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
}

.level-badge, .score-badge {
	background: rgba(255,255,255,0.9);
	color: var(--primary-color);
	padding: 8px 16px;
	border-radius: 20px;
	font-weight: 600;
	font-size: 16px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-fullscreen {
	background: rgba(255,255,255,0.2);
	border: 2px solid rgba(255,255,255,0.5);
	color: white;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
}

.btn-fullscreen:hover {
	background: rgba(255,255,255,0.3);
	transform: scale(1.1);
}

.btn-fullscreen:active {
	transform: scale(0.95);
}

/* ===================================
   ÁREA DO JOGO
   =================================== */

.game-area {
	padding: 30px 20px;
	min-height: 450px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.level-content {
	width: 100%;
	max-width: 100%;
	animation: fadeIn 0.5s ease;
}

.level-content h3 {
	color: var(--primary-color);
	font-size: 24px;
	font-weight: 600;
	text-align: center;
	margin: 0 0 30px 0;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ===================================
   INSTRUÇÕES
   =================================== */

.instructions {
	text-align: center;
	max-width: 600px;
	animation: fadeIn 0.6s ease;
}

.instructions h2 {
	color: var(--primary-color);
	font-size: 32px;
	margin-bottom: 20px;
}

.instructions p {
	font-size: 18px;
	color: #555;
	margin: 15px 0;
	line-height: 1.6;
}

.instructions strong {
	color: var(--primary-color);
}

/* ===================================
   ALFABETO GRID
   =================================== */

.alphabet-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	max-width: 600px;
	margin: 0 auto;
	padding: 0 10px;
}

.alphabet-grid.small {
	gap: 10px;
	max-width: 500px;
}

.letter-btn {
	aspect-ratio: 1;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border: 3px solid var(--primary-color);
	border-radius: 16px;
	font-size: 36px;
	font-weight: 700;
	color: var(--primary-color);
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 4px 12px rgba(94,79,162,0.2);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60px;
}

.letter-btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: var(--secondary-color);
	transform: translate(-50%, -50%);
	transition: width 0.4s, height 0.4s;
}

.letter-btn:hover {
	transform: translateY(-4px) scale(1.05);
	box-shadow: 0 8px 20px rgba(94,79,162,0.3);
	border-color: var(--secondary-color);
}

.letter-btn:active,
.letter-btn.active {
	transform: scale(0.95);
	background: var(--secondary-color);
	color: white;
	border-color: var(--secondary-color);
}

.letter-btn.played {
	background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
	color: white;
	border-color: #4caf50;
}

.letter-btn.correct {
	animation: correctAnswer 0.6s ease;
}

.letter-btn.wrong {
	animation: wrongAnswer 0.6s ease;
}

.letter-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@keyframes correctAnswer {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.2); }
}

@keyframes wrongAnswer {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-10px); }
	75% { transform: translateX(10px); }
}

/* ===================================
   BOTÕES PRINCIPAIS
   =================================== */

.btn-primary, .btn-secondary, .btn-next {
	padding: 16px 32px;
	font-size: 20px;
	font-weight: 600;
	border: none;
	border-radius: 30px;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 4px 15px rgba(0,0,0,0.2);
	margin: 20px auto;
	display: block;
	min-width: 200px;
}

.btn-primary {
	background: var(--bg-gradient);
	color: white;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-secondary {
	background: #f5f5f5;
	color: var(--primary-color);
}

.btn-next {
	background: var(--success-color);
	color: white;
}

/* ===================================
   ÁUDIO CONTROL
   =================================== */

.audio-control {
	text-align: center;
	margin: 30px 0;
}

.btn-audio {
	background: var(--bg-gradient);
	color: white;
	border: none;
	padding: 20px 40px;
	border-radius: 60px;
	font-size: 20px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 15px;
	box-shadow: 0 6px 20px rgba(94,79,162,0.3);
	transition: var(--transition);
}

.btn-audio:hover {
	transform: scale(1.05);
	box-shadow: 0 8px 25px rgba(94,79,162,0.4);
}

.btn-audio:active {
	transform: scale(0.98);
}

.btn-audio svg {
	width: 32px;
	height: 32px;
}

/* ===================================
   OPTIONS GRID (NÍVEL 2)
   =================================== */

.options-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	max-width: 500px;
	margin: 30px auto;
	padding: 0 10px;
}

.option-btn {
	aspect-ratio: 1;
	background: white;
	border: 3px solid var(--primary-color);
	border-radius: 16px;
	font-size: 42px;
	font-weight: 700;
	color: var(--primary-color);
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70px;
}

.option-btn:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.option-btn:active {
	transform: scale(0.95);
}

/* ===================================
   WORD DISPLAY (NÍVEL 3)
   =================================== */

.word-display {
	margin: 30px 0;
	text-align: center;
}

.target-word {
	font-size: 32px;
	font-weight: 700;
	color: var(--primary-color);
	margin-bottom: 20px;
	letter-spacing: 4px;
}

.player-word {
	min-height: 80px;
	background: #f8f9fa;
	border: 3px dashed var(--primary-color);
	border-radius: 16px;
	padding: 20px;
	font-size: 36px;
	font-weight: 700;
	color: var(--secondary-color);
	letter-spacing: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ===================================
   FEEDBACK
   =================================== */

.feedback {
	text-align: center;
	margin: 25px 0;
	font-size: 24px;
	font-weight: 600;
	padding: 15px;
	border-radius: 12px;
	animation: fadeIn 0.4s ease;
}

.feedback.success {
	background: rgba(76,175,80,0.1);
	color: var(--success-color);
}

.feedback.error {
	background: rgba(244,67,54,0.1);
	color: var(--error-color);
}

/* ===================================
   VICTORY SCREEN
   =================================== */

.victory-screen {
	text-align: center;
	animation: victoryPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes victoryPop {
	0% {
		opacity: 0;
		transform: scale(0.5) rotate(-10deg);
	}
	100% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
}

.victory-content {
	background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
	padding: 40px 30px;
	border-radius: 24px;
	max-width: 500px;
	margin: 0 auto;
}

.victory-content h2 {
	font-size: 48px;
	color: var(--primary-color);
	margin: 0 0 20px 0;
}

.victory-message {
	font-size: 22px;
	color: #555;
	margin: 20px 0;
}

.final-score {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 30px 0;
}

.score-label {
	font-size: 18px;
	color: #666;
}

.score-value {
	font-size: 56px;
	font-weight: 700;
	color: var(--primary-color);
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-container {
	background: #e0e0e0;
	height: 8px;
	border-radius: 0 0 20px 20px;
	overflow: hidden;
}

.progress-bar {
	background: var(--bg-gradient);
	height: 100%;
	width: 0;
	transition: width 0.4s ease;
}

/* ===================================
   DESCRIÇÃO SEO
   =================================== */

.descricao_jogo {
	background: white;
	padding: 30px;
	border-radius: 16px;
	margin: 30px 0;
	box-shadow: var(--card-shadow);
}

.descricao_jogo h2 {
	font-size: 26px;
	margin-bottom: 20px;
}

.descricao_jogo h3 {
	font-size: 22px;
	margin: 25px 0 15px;
}

.descricao_jogo p, .descricao_jogo ul {
	font-size: 16px;
	line-height: 1.8;
	margin: 15px 0;
}

.descricao_jogo ul {
	padding-left: 25px;
}

.descricao_jogo li {
	margin: 10px 0;
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */

@media (max-width: 768px) {
	.game-wrapper {
		padding: 15px 0 30px;
	}

	h1 {
		font-size: 22px;
		margin: 0 0 15px 0;
	}

	.game-header {
		padding: 15px;
		flex-wrap: wrap;
	}

	.level-info {
		gap: 10px;
	}

	.level-badge, .score-badge {
		font-size: 14px;
		padding: 6px 12px;
	}

	.btn-fullscreen {
		width: 40px;
		height: 40px;
	}

	.btn-fullscreen svg {
		width: 20px;
		height: 20px;
	}

	.game-area {
		padding: 20px 10px;
		min-height: 380px;
	}

	.level-content h3 {
		font-size: 20px;
		margin-bottom: 20px;
	}

	.instructions h2 {
		font-size: 26px;
	}

	.instructions p {
		font-size: 16px;
	}

	/* Alfabeto Grid Mobile */
	.alphabet-grid {
		gap: 10px;
		padding: 0 5px;
	}

	.letter-btn {
		font-size: 32px;
		border-width: 2px;
		border-radius: 12px;
		min-height: 55px;
	}

	/* Options Grid Mobile */
	.options-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}

	.option-btn {
		font-size: 36px;
		min-height: 60px;
	}

	/* Botões Mobile */
	.btn-primary, .btn-secondary, .btn-next {
		padding: 14px 28px;
		font-size: 18px;
		min-width: 180px;
	}

	.btn-audio {
		padding: 16px 32px;
		font-size: 18px;
		gap: 12px;
	}

	.btn-audio svg {
		width: 28px;
		height: 28px;
	}

	/* Word Display Mobile */
	.target-word {
		font-size: 26px;
		letter-spacing: 3px;
	}

	.player-word {
		min-height: 70px;
		font-size: 30px;
		letter-spacing: 4px;
		padding: 15px;
	}

	/* Victory Screen Mobile */
	.victory-content {
		padding: 30px 20px;
	}

	.victory-content h2 {
		font-size: 40px;
	}

	.victory-message {
		font-size: 18px;
	}

	.score-value {
		font-size: 48px;
	}

	/* Descrição SEO Mobile */
	.descricao_jogo {
		padding: 20px 15px;
	}

	.descricao_jogo h2 {
		font-size: 22px;
	}

	.descricao_jogo h3 {
		font-size: 20px;
	}

	.descricao_jogo p, .descricao_jogo ul {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	/* Alfabeto Grid Extra Small */
	.alphabet-grid {
		gap: 8px;
	}

	.letter-btn {
		font-size: 28px;
		min-height: 50px;
	}

	.options-grid {
		gap: 10px;
	}

	.option-btn {
		font-size: 32px;
		min-height: 55px;
	}

	.feedback {
		font-size: 20px;
	}
}

/* ===================================
   FULLSCREEN MODE
   =================================== */

.game-container:-webkit-full-screen {
	background: #f5f7fa;
}

.game-container:-moz-full-screen {
	background: #f5f7fa;
}

.game-container:fullscreen {
	background: #f5f7fa;
	display: flex;
	flex-direction: column;
}

.game-container:fullscreen .game-area {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ===================================
   ACESSIBILIDADE
   =================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Focus visible para navegação por teclado */
button:focus-visible,
.letter-btn:focus-visible,
.option-btn:focus-visible {
	outline: 3px solid var(--secondary-color);
	outline-offset: 3px;
}
