/**
 * Deletreando Game Styles
 * 
 * @package Deletreando
 */

/* ========================================
   Container & Layout
   ======================================== */

.deletreando-game-container {
	max-width: 800px;
	margin: 40px auto;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

/* ========================================
   Header
   ======================================== */

.deletreando-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	padding: 24px 32px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.deletreando-logo {
	display: flex;
	align-items: center;
	gap: 12px;
}

.deletreando-icon {
	font-size: 32px;
}

.deletreando-logo h2 {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	color: #ffffff;
}

.deletreando-stats {
	display: flex;
	gap: 24px;
}

.stat-item {
	text-align: right;
}

.stat-label {
	display: block;
	font-size: 12px;
	opacity: 0.9;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.stat-value {
	display: block;
	font-size: 24px;
	font-weight: 700;
}

/* ========================================
   Content Area
   ======================================== */

.deletreando-content {
	padding: 40px 32px;
	min-height: 400px;
	position: relative;
}

/* ========================================
   Loading State
   ======================================== */

.deletreando-loading {
	text-align: center;
	padding: 60px 20px;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #667eea;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 20px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.deletreando-loading p {
	color: #666;
	font-size: 16px;
}

/* ========================================
   Game Area
   ======================================== */

.deletreando-game-area {
	animation: fadeIn 0.3s ease-in;
}

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

/* Word Display */
.deletreando-word-display {
	text-align: center;
	margin-bottom: 40px;
}

.deletreando-word-display h3 {
	font-size: 18px;
	color: #666;
	margin: 0 0 16px 0;
	font-weight: 500;
}

.word-to-spell {
	font-size: 48px;
	font-weight: 700;
	color: #333;
	padding: 20px;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	border-radius: 12px;
	margin-bottom: 16px;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.word-hint {
	font-size: 14px;
	color: #666;
	font-style: italic;
	padding: 12px 20px;
	background: #fff9e6;
	border-left: 4px solid #ffc107;
	border-radius: 4px;
	text-align: left;
	margin-top: 16px;
}

/* Input Area */
.deletreando-input-area {
	margin-bottom: 32px;
}

/* Letter Boxes Container (Hangman Style) */
.letter-boxes-container {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 24px;
	flex-wrap: wrap;
	min-height: 80px;
	align-items: center;
}

.letter-box {
	width: 60px;
	height: 70px;
	border-bottom: 4px solid #667eea;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	font-weight: 700;
	color: #333;
	background: transparent;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
	font-family: inherit;
}

/* Letter hint styling */
.letter-box .letter-hint {
	position: absolute;
	font-size: 36px;
	font-weight: 700;
	color: #667eea;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.letter-box .user-input {
	position: absolute;
	font-size: 36px;
	font-weight: 700;
	color: #333;
	z-index: 1;
}

.letter-box.active {
	border-bottom-color: #764ba2;
	animation: pulse 1.5s ease-in-out infinite;
}

.letter-box.filled {
	color: #667eea;
	transform: scale(1.05);
}

.letter-box:hover {
	background: rgba(102, 126, 234, 0.05);
}

@keyframes pulse {
	0%, 100% { border-bottom-color: #764ba2; }
	50% { border-bottom-color: #667eea; }
}

.letter-boxes-container.shake {
	animation: shake 0.5s;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
	20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Hidden Input for Mobile Keyboard */
.deletreando-input-hidden {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Action Buttons */
.action-buttons {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	justify-content: center;
}

/* Buttons */
.deletreando-btn {
	padding: 16px 32px;
	font-size: 16px;
	font-weight: 600;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-family: inherit;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.deletreando-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.deletreando-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.deletreando-btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
}

.deletreando-btn-secondary {
	background: #f5f5f5;
	color: #333;
}

.deletreando-btn-secondary:hover {
	background: #e0e0e0;
}

/* Spanish Keyboard */
.deletreando-keyboard {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
}

.keyboard-label {
	font-size: 13px;
	color: #666;
	margin: 0 0 12px 0;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.keyboard-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.keyboard-btn {
	min-width: 44px;
	height: 44px;
	padding: 8px 12px;
	background: #ffffff;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #333;
}

.keyboard-btn:hover {
	background: #667eea;
	color: #ffffff;
	border-color: #667eea;
	transform: scale(1.05);
}

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

/* ========================================
   Feedback Area
   ======================================== */

.deletreando-feedback {
	text-align: center;
	padding: 32px;
	border-radius: 12px;
	margin-top: 32px;
	animation: slideUp 0.3s ease-out;
}

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

.deletreando-feedback.feedback-success {
	background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
	border: 2px solid #28a745;
}

.deletreando-feedback.feedback-error {
	background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
	border: 2px solid #dc3545;
}

.deletreando-feedback.celebrate {
	animation: celebrate 0.6s ease-out;
}

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

.feedback-icon {
	font-size: 64px;
	margin-bottom: 16px;
}

.feedback-message {
	font-size: 24px;
	margin-bottom: 16px;
	color: #333;
}

.feedback-correct-word {
	font-size: 18px;
	color: #666;
	margin-bottom: 24px;
}

.feedback-correct-word strong {
	color: #dc3545;
	font-size: 22px;
}

/* ========================================
   Complete Screen
   ======================================== */

.deletreando-complete {
	text-align: center;
	padding: 40px 20px;
	animation: fadeIn 0.5s ease-in;
}

.complete-icon {
	font-size: 80px;
	margin-bottom: 24px;
	animation: bounce 1s ease-in-out;
}

@keyframes bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-20px); }
}

.deletreando-complete h3 {
	font-size: 32px;
	color: #333;
	margin: 0 0 16px 0;
}

.complete-message {
	font-size: 18px;
	color: #666;
	margin-bottom: 32px;
}

.complete-stats {
	display: flex;
	justify-content: center;
	gap: 40px;
	margin-bottom: 32px;
	padding: 24px;
	background: #f8f9fa;
	border-radius: 12px;
}

.complete-stat {
	text-align: center;
}

.complete-stat-label {
	display: block;
	font-size: 14px;
	color: #666;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.complete-stat-value {
	display: block;
	font-size: 36px;
	font-weight: 700;
	color: #667eea;
}

/* ========================================
   Error Screen
   ======================================== */

.deletreando-error {
	text-align: center;
	padding: 60px 20px;
}

.error-icon {
	font-size: 64px;
	margin-bottom: 24px;
}

.error-message {
	font-size: 18px;
	color: #666;
	margin-bottom: 32px;
}

/* ========================================
   Footer
   ======================================== */

.deletreando-footer {
	background: #f8f9fa;
	padding: 16px 32px;
	text-align: center;
	border-top: 1px solid #e0e0e0;
}

.deletreando-credits {
	margin: 0;
	font-size: 13px;
	color: #666;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
	.deletreando-game-container {
		margin: 20px;
		border-radius: 12px;
	}

	.deletreando-header {
		flex-direction: column;
		gap: 16px;
		padding: 20px;
	}

	.deletreando-logo h2 {
		font-size: 24px;
	}

	.deletreando-stats {
		width: 100%;
		justify-content: space-around;
	}

	.deletreando-content {
		padding: 24px 16px;
		min-height: 300px;
	}

	.word-to-spell {
		font-size: 36px;
		padding: 16px;
	}

	.letter-box {
		width: 50px;
		height: 60px;
		font-size: 30px;
	}

	.letter-box .letter-hint,
	.letter-box .user-input {
		font-size: 30px;
	}

	.action-buttons {
		flex-direction: column;
	}

	.deletreando-btn {
		width: 100%;
		padding: 14px 24px;
	}

	.keyboard-buttons {
		justify-content: center;
	}

	.complete-stats {
		flex-direction: column;
		gap: 20px;
	}

	.stat-value {
		font-size: 20px;
	}
}

@media (max-width: 480px) {
	.deletreando-icon {
		font-size: 24px;
	}

	.deletreando-logo h2 {
		font-size: 20px;
	}

	.word-to-spell {
		font-size: 28px;
		letter-spacing: 1px;
	}

	.letter-box {
		width: 40px;
		height: 50px;
		font-size: 24px;
		gap: 6px;
	}

	.letter-box .letter-hint,
	.letter-box .user-input {
		font-size: 24px;
	}

	.letter-boxes-container {
		gap: 6px;
	}

	.keyboard-btn {
		min-width: 40px;
		height: 40px;
		font-size: 16px;
	}

	.feedback-icon {
		font-size: 48px;
	}

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

	.complete-icon {
		font-size: 60px;
	}

	.deletreando-complete h3 {
		font-size: 24px;
	}

	.complete-stat-value {
		font-size: 28px;
	}
}

/* ========================================
   Accessibility
   ======================================== */

.deletreando-btn:focus,
.deletreando-input:focus,
.keyboard-btn:focus {
	outline: 3px solid #667eea;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.deletreando-game-container {
		border: 2px solid #000;
	}

	.deletreando-btn-primary {
		background: #000;
		color: #fff;
	}

	.keyboard-btn {
		border-width: 2px;
	}
}

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

/* Print styles */
@media print {
	.deletreando-keyboard,
	.deletreando-btn,
	.deletreando-footer {
		display: none;
	}
}
