/**
 * Relatia Games Styles
 *
 * @since 1.3.134
 */

/* ══════════════════════════════════════════════════════════════
   GENERAL GAME WRAPPER
   ══════════════════════════════════════════════════════════════ */

.relatia-game-wrapper {
	max-width: 1200px;
	margin: 40px auto;
	padding: 30px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.relatia-game-header {
	margin-bottom: 30px;
	text-align: center;
}

.relatia-game-title {
	font-size: 32px;
	margin: 0 0 15px;
	color: #1f2937;
}

.relatia-game-instructions {
	font-size: 16px;
	color: #6b7280;
	line-height: 1.6;
}

.relatia-game-content {
	margin-top: 30px;
}

/* ══════════════════════════════════════════════════════════════
   WORD SEARCH (SOPA DE LETRAS)
   ══════════════════════════════════════════════════════════════ */

.relatia-wordsearch-game {
	display: flex;
	gap: 30px;
	align-items: flex-start;
}

.relatia-wordsearch-words {
	flex: 0 0 250px;
}

.relatia-wordsearch-words h3 {
	font-size: 18px;
	margin: 0 0 15px;
	color: #1f2937;
}

.relatia-wordsearch-word-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.relatia-wordsearch-word-list li {
	padding: 8px 12px;
	margin-bottom: 5px;
	background: #f3f4f6;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	color: #374151;
	transition: all 0.3s;
}

.relatia-wordsearch-word-list li.found {
	background: #10b981;
	color: #fff;
	text-decoration: line-through;
}

.relatia-wordsearch-grid-container {
	flex: 1;
}

.relatia-wordsearch-table {
	border-collapse: collapse;
	margin: 0 auto;
	user-select: none;
}

.relatia-wordsearch-table td {
	width: 30px;
	height: 30px;
	text-align: center;
	border: 1px solid #e5e7eb;
	font-size: 16px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s;
}

.relatia-wordsearch-table td:hover {
	background: #f9fafb;
}

.relatia-wordsearch-table td.selecting {
	background: #ffe4d6;
	color: #8a3500;
}

.relatia-wordsearch-table td.found {
	background: #10b981;
	color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   CROSSWORD (CRUCIGRAMA)
   ══════════════════════════════════════════════════════════════ */

.relatia-crossword-game {
	display: flex;
	flex-direction: column;
	gap: 30px;
	align-items: center;
	max-width: 1200px;
	margin: 0 auto;
}

.relatia-crossword-grid-container {
	width: 100%;
	overflow-x: auto;
	padding: 20px;
	background: #f9fafb;
	border-radius: 12px;
}

.relatia-crossword-table {
	border-collapse: collapse;
	margin: 0 auto;
}

.relatia-crossword-table td {
	width: 42px;
	height: 42px;
	border: 2px solid #d1d5db;
	position: relative;
}

.relatia-crossword-table .crossword-empty {
	background: #727272;
	border-color: #515357;
}

.relatia-crossword-table .crossword-cell {
	background: #fff;
}

.relatia-crossword-table .crossword-cell.correct {
	background: #9affdd;
}

.relatia-crossword-table .crossword-cell.incorrect {
	background: #ffa1a1;
}

.relatia-crossword-table .cell-number {
	position: absolute;
	top: 2px;
	left: 4px;
	font-size: 10px;
	font-weight: 700;
	color: #b84700;
}

.relatia-crossword-table input {
	width: 100%;
	height: 100%;
	border: none;
	background: transparent;
	text-align: center;
	font-size: 20px;
	font-weight: 700;
	color: #1f2937;
	text-transform: uppercase;
	outline: none;
	padding: 0;
	margin: 0;
}

.relatia-crossword-table input:focus {
	background: #ffe4d6;
}

.relatia-crossword-clues-container {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	padding: 20px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
}

.relatia-crossword-section h3 {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 16px;
	color: #1f2937;
	border-bottom: 2px solid #b84700;
	padding-bottom: 8px;
}

.relatia-crossword-clues-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.relatia-crossword-clues-list li {
	padding: 8px 0;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.6;
	border-bottom: 1px solid #f3f4f6;
}

.relatia-crossword-clues-list li:last-child {
	border-bottom: none;
}

.relatia-crossword-clues-list li strong {
	color: #b84700;
	margin-right: 8px;
}

/* Dark theme */
[data-theme="dark"] .relatia-crossword-grid-container {
	background: #1f2937;
}

[data-theme="dark"] .relatia-crossword-table .crossword-cell {
	background: #374151;
	border-color: #4b5563;
}

[data-theme="dark"] .relatia-crossword-table .crossword-empty {
	background: #111827;
	border-color: #111827;
}

[data-theme="dark"] .relatia-crossword-table input {
	color: #f9fafb;
}

[data-theme="dark"] .relatia-crossword-table input:focus {
	background: #5c2600;
}

[data-theme="dark"] .relatia-crossword-clues-container {
	background: #1f2937;
	border-color: #374151;
}

[data-theme="dark"] .relatia-crossword-section h3 {
	color: #f9fafb;
}

[data-theme="dark"] .relatia-crossword-clues-list li {
	color: #d1d5db;
	border-bottom-color: #374151;
}

/* ══════════════════════════════════════════════════════════════
   MAZE (LABERINTO)
   ══════════════════════════════════════════════════════════════ */

.relatia-maze-game {
	text-align: center;
}

.relatia-maze-controls {
	margin-bottom: 20px;
	display: flex;
	gap: 10px;
	justify-content: center;
}

.relatia-maze-grid-container {
	display: inline-block;
	padding: 20px;
	background: #f9fafb;
	border-radius: 8px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.relatia-maze-canvas {
	display: block;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
	.relatia-game-wrapper {
		padding: 20px;
	}

	.relatia-wordsearch-game {
		flex-direction: column;
	}

	.relatia-wordsearch-words {
		flex: 1 1 auto;
		width: 100%;
	}

	.relatia-wordsearch-table td {
		width: 25px;
		height: 25px;
		font-size: 14px;
	}

	.relatia-crossword-game {
		flex-direction: column;
	}

	.relatia-crossword-clues-container {
		flex: 1 1 auto;
		width: 100%;
	}

	.relatia-crossword-table td {
		width: 30px;
		height: 30px;
	}

	.relatia-crossword-table input {
		font-size: 16px;
	}

	.relatia-maze-grid-container {
		padding: 10px;
	}

	.relatia-maze-canvas {
		max-width: 100%;
		height: auto;
	}
}

/* ══════════════════════════════════════════════════════════════
   GAME POPUPS - ICONS
   ══════════════════════════════════════════════════════════════ */

.relatia-game-popup-icon {
	font-size: 64px;
}

.relatia-game-popup-icon-success {
	color: #10b981;
}

.relatia-game-popup-icon-info {
	color: #b84700;
}

/* ══════════════════════════════════════════════════════════════
   DARK THEME
   ══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .relatia-game-wrapper {
	background: #1f2937;
}

[data-theme="dark"] .relatia-game-title {
	color: #f3f4f6;
}

[data-theme="dark"] .relatia-game-instructions {
	color: #9ca3af;
}

[data-theme="dark"] .relatia-wordsearch-word-list li {
	background: #374151;
	color: #e5e7eb;
}

[data-theme="dark"] .relatia-wordsearch-table td {
	border-color: #4b5563;
	color: #e5e7eb;
	background: #374151;
}

[data-theme="dark"] .relatia-wordsearch-table td:hover {
	background: #4b5563;
}

[data-theme="dark"] .relatia-wordsearch-table td.selecting {
	background: #8a3500;
	color: #fff;
}

[data-theme="dark"] .relatia-crossword-table .crossword-empty {
	background: #374151;
}

[data-theme="dark"] .relatia-crossword-table .crossword-cell {
	background: #1f2937;
	border-color: #4b5563;
}

[data-theme="dark"] .relatia-crossword-table input {
	color: #f3f4f6;
}

[data-theme="dark"] .relatia-crossword-table input:focus {
	background: #5c2600;
}

[data-theme="dark"] .relatia-crossword-across h3,
[data-theme="dark"] .relatia-crossword-down h3 {
	color: #f3f4f6;
}

[data-theme="dark"] .relatia-crossword-clues-container li {
	color: #d1d5db;
}

[data-theme="dark"] .relatia-maze-grid-container {
	background: #374151;
}

[data-theme="dark"] .relatia-maze-canvas {
	background: #1f2937;
	border-color: #4b5563;
}

/* ══════════════════════════════════════════════════════════════
   GAME ACTIONS (BOTONES)
   ══════════════════════════════════════════════════════════════ */

.relatia-game-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 20px;
	padding: 20px;
}

/* Responsive: Stack buttons and enable scroll on small screens */
@media (max-width: 640px) {
	.relatia-crossword-game {
		gap: 20px;
	}

	.relatia-crossword-grid-container {
		padding: 10px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.relatia-crossword-table {
		min-width: max-content;
	}

	.relatia-crossword-table td {
		width: 32px;
		height: 32px;
		min-width: 32px;
		min-height: 32px;
	}

	.relatia-crossword-table input {
		font-size: 16px;
	}

	.relatia-crossword-clues-container {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 15px;
	}

	/* Word Search scroll */
	.relatia-wordsearch-grid-container {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.relatia-wordsearch-table {
		min-width: max-content;
	}

	/* Maze scroll */
	.relatia-maze-grid-container {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.relatia-maze-canvas {
		min-width: 300px;
	}

	.relatia-game-actions {
		flex-direction: column;
		width: 100%;
	}

	.relatia-game-actions .relatia-btn {
		width: 100%;
	}
}

