/* ================================
   FONT FACES
   ================================ */
@font-face {
	font-family: 'rubikRegular';
	src: url('assets/fonts/Rubik-Regular.ttf');
	font-weight: normal;
}

@font-face {
	font-family: 'rubikBold';
	src: url('assets/fonts/Rubik-Bold.ttf');
	font-weight: normal;
}

@font-face {
	font-family: 'rubikMedium';
	src: url('assets/fonts/Rubik-Medium.ttf');
	font-weight: normal;
}

/* ================================
   CSS VARIABLES
   ================================ */
:root {
	--primary: #f48024; /* Vibrant orange from reference */
	--primary-hover: #e9771b; /* Darker orange for hover */
	--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
	--accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
	--secondary: #253544; /* Deep blue from reference */
	--secondary-hover: #1a2530; /* Darker blue for hover */
	--black: #000000;
	--accent: #2196f3; /* Blue accent */
	--accent-hover: #1a75c1; /* Darker blue */
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ef4444;
	--text-light: #ffffff; /* White text */
	--text-dark: #253544; /* Dark text for light backgrounds */
	--text-muted: #8c9daa; /* Light blue-gray */
	--bg-dark: #1a2530; /* Deep blue background */
	--bg-darker: #161f29; /* Even deeper blue background */
	--bg-light: #f5f5f5; /* Light background */
	--border-radius: 8px;
	--transition: all 0.2s ease;
	--transform: scale(1.05);
	--navbar-height: 70px;
}

/* ================================
   BASE STYLES
   ================================ */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	cursor: default;
}

body {
	font-family: 'rubikRegular', sans-serif;
	color: var(--text-dark);
	line-height: 1.6;
	background-color: #667eea;
	background-attachment: fixed;
	padding-top: var(--navbar-height);
}

.hidden {
	display: none !important;
}

.page {
	display: none;
}

.page.active {
	display: block;
}

/* Tooltip styles */
/* Updated tooltip styles */
.tooltip-text {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.9);
	color: white;
	text-align: center;
	padding: 8px 12px;
	border-radius: 6px;
	z-index: 1000;
	white-space: nowrap;
	font-size: 14px;
	font-weight: normal;
	line-height: 1.2;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	visibility: hidden;
	opacity: 0;
}

/* Arrow pointing down (default - tooltip above element) */
.tooltip-text::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

/* Arrow pointing up (when tooltip is below element) */
.tooltip-text.tooltip-below::after {
	top: -10px;
	border-color: transparent transparent rgba(0, 0, 0, 0.9) transparent;
}

/* Manual active state - can be clicked */
.tooltip-text.manual-active {
	pointer-events: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Animation keyframe (add to existing animations section) */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Apply fade animation to lobby elements */
.lobby-container {
	opacity: 0;
	animation: fadeIn 0.3s ease-out forwards;
}

/* .lobby-header {
	opacity: 0;
	animation: fadeIn 0.4s ease-out forwards;
}

.lobby-actions {
	opacity: 0;
	animation: fadeIn 0.4s ease-out forwards;
}

.rooms-list {
	opacity: 0;
	animation: fadeIn 0.4s ease-out forwards;
}

.player-count {
	opacity: 0;
	animation: fadeIn 0.4s ease-out forwards;
}

.lobby-buttons {
	opacity: 0;
	animation: fadeIn 0.4s ease-out forwards;
} */

/* ================================
   TOP NAVIGATION BAR
   ================================ */
.top-navbar {
	position: fixed;
	display: block;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--navbar-height);
	background: white;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 2px 4px rgba(6, 17, 118, 0.08), 0 4px 12px rgba(6, 17, 118, 0.08);
	z-index: 1000;
}

.navbar-content {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 1rem;
	gap: 2rem; /* Add gap between sections */
}

.navbar-left,
.navbar-center,
.navbar-right {
	display: flex;
	align-items: center;
	flex: 1; /* Don't allow flex grow/shrink */
}

.navbar-left {
	justify-content: flex-start;
}

.navbar-center {
	justify-content: center;
}

.navbar-right {
	justify-content: flex-end;
}

.navbar-logo {
	height: auto;
	width: 150px;
	cursor: pointer;
}

.player-info-area {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.player-avatar {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background-color: var(--bg-light);
	border: 2px solid var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	user-select: none;
	transition: var(--transition);
}

.player-avatar:hover {
	transform: var(--transform);
}

.player-nickname {
	color: var(--text-dark);
	font-family: 'rubikMedium', sans-serif;
	font-size: 1.1rem;
	white-space: nowrap;
}

.leaderboard-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	margin: 0 1rem;
	background-color: var(--bg-light);
	color: white;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
	white-space: nowrap;
}

.leaderboard-btn:hover {
	background-color: rgba(244, 128, 36, 0.1);
	border-color: var(--primary);
	transform: translateY(-1px);
}

.leaderboard-text {
	font-family: 'rubikMedium', sans-serif;
	font-size: 1rem;
	color: var(--text-dark);
	letter-spacing: 0.5px;
	max-lines: 1;
	cursor: inherit;
}

.leaderboard-icon {
	font-size: 1rem;
	cursor: inherit;
}

.player-currency {
	display: flex;
	align-items: center;
	user-select: none;
	cursor: pointer;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: var(--border-radius);
	background-color: var(--bg-light);
	border: 1px solid rgba(0, 0, 0, 0.1);
	transition: var(--transition);
}

.player-currency:hover {
	background-color: rgba(244, 128, 36, 0.1);
	border-color: var(--primary);
	transform: translateY(-1px);
}

.currency-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
	cursor: inherit;
}

.currency-amount {
	font-family: 'rubikMedium', sans-serif;
	font-size: 1rem;
	color: var(--text-dark);
	white-space: nowrap;
	cursor: inherit;
}

/* ================================
   LOBBY STYLES
   ================================ */
.lobby-container {
	max-width: 900px;
	margin: 2rem auto;
	padding: 2rem;
	display: none;
	background: white;
	border-radius: var(--border-radius);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.lobby-header {
	margin-bottom: 2rem;
}

.lobby-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	gap: 1rem;
}

.player-count {
	color: #808f9b;
	font-size: 1rem;
	font-family: 'rubikMedium', sans-serif;
	padding: 0.75rem 0.75rem;
	background: #ececec;
	border-radius: var(--border-radius);
	letter-spacing: 0.5px;
}

.lobby-buttons {
	display: flex;
	gap: 1rem;
}

.quick-join-btn {
	padding: 0.875rem 2rem;
	background-color: var(--primary);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
	font-family: 'rubikMedium', sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.quick-join-btn:hover {
	background-color: var(--primary-hover);
	transform: translateY(-2px);
}

.tutorial-btn {
	padding: 0.875rem 1.5rem;
	background-color: var(--accent);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
	font-family: 'rubikMedium', sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.tutorial-btn:hover {
	background-color: var(--accent-hover);
	transform: translateY(-2px);
}

/* ================================
   ROOMS LIST STYLES
   ================================ */
.rooms-list {
	width: 100%;
	border-collapse: collapse;
	background: var(--bg-light);
	border-radius: var(--border-radius);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.rooms-list th,
.rooms-list td {
	padding: 1.25rem;
	text-align: center;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.rooms-list th {
	background-color: var(--bg-dark);
	font-family: 'rubikMedium', sans-serif;
	color: var(--text-light);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 0.875rem;
}

.rooms-list tr:last-child td {
	border-bottom: none;
}

.rooms-list tr {
	transition: var(--transition);
}

.rooms-list tr:hover {
	background: rgba(244, 128, 36, 0.05);
}

.rooms-list thead {
	pointer-events: none;
}

.rooms-list button {
	padding: 0.5rem 1rem;
	background-color: var(--primary);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
	font-family: 'rubikMedium', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 0.75rem;
	min-width: 60px;
}

.rooms-list button:hover:not(:disabled) {
	background-color: var(--primary-hover);
	box-shadow: 0 2px 8px rgba(244, 128, 36, 0.3);
}

.rooms-list button:disabled {
	background-color: var(--text-muted);
	cursor: not-allowed;
	opacity: 0.6;
}

.room-status {
	padding: 0.5rem 1rem;
	border-radius: 20px;
	font-size: 0.75rem;
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: 'rubikMedium', sans-serif;
}

.status-waiting {
	background-color: rgba(33, 150, 243, 0.2);
	color: var(--accent);
}

.status-full {
	background-color: rgba(244, 67, 54, 0.2);
	color: var(--danger);
}

.status-started {
	background-color: rgba(244, 128, 36, 0.2);
	color: var(--primary);
}

.players-info {
	text-align: center;
}

.player-count-text {
	margin-bottom: 0.25rem;
	color: var(--text-dark);
}

.player-nicknames {
	font-size: 0.8rem;
	color: var(--text-muted);
	line-height: 1.2;
	word-break: break-word;
	max-width: 150px;
	margin: 0 auto;
}

/* ================================
   RESPONSIVE STYLES
   ================================ */
@media (max-width: 1300px) {
	.player-avatar {
		border: 3px solid var(--primary);
	}
}

@media (max-width: 1024px) {
	.navbar-content {
		padding: 0 1rem;
	}

	.lobby-container {
		margin: 1rem;
		padding: 1.5rem;
	}
}

@media (max-width: 768px) {
	.navbar-content {
		padding: 0 0.5rem;
	}

	.navbar-left,
	.navbar-right {
		flex: 0.8;
	}

	.navbar-center {
		flex: 1.4;
	}

	.navbar-logo {
		width: 100px;
	}

	.player-nickname {
		font-size: 1rem;
	}

	.player-currency {
		padding: 0.4rem 0.8rem;
		gap: 0.4rem;
	}

	.leaderboard-btn {
		padding: 0.4rem 0.8rem;
	}

	.leaderboard-text {
		display: none;
	}

	.leaderboard-icon {
		font-size: 0.9rem;
	}

	.currency-icon {
		width: 20px;
		height: 20px;
	}

	.currency-amount {
		font-size: 0.9rem;
	}

	.leaderboard-text {
		font-size: 0.9rem;
	}

	.nickname-form {
		padding: 2rem;
		margin: 1rem;
	}

	.nickname-title {
		font-size: 1.5rem;
	}

	.avatar-preview-section {
		flex-direction: column;
		gap: 0.5rem;
	}

	.selected-avatar-preview {
		width: 50px;
		height: 50px;
		font-size: 20px;
	}

	.avatar-grid {
		grid-template-columns: repeat(6, 1fr);
		gap: 0.25rem;
		padding: 0.75rem;
	}

	.avatar-option {
		width: 40px;
		height: 40px;
	}

	.avatar-emoji {
		font-size: 20px;
	}

	.lobby-container {
		margin: 1rem 0.5rem;
		padding: 1rem;
	}

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

	.player-count {
		text-align: center;
	}

	.rooms-list th,
	.rooms-list td {
		padding: 0.8rem 0.5rem;
		font-size: 0.8rem;
	}

	.rooms-list button {
		padding: 0.4rem 0.8rem;
		font-size: 0.7rem;
		min-width: 50px;
	}

	.player-nicknames {
		font-size: 0.7rem;
		max-width: 120px;
	}
}

@media (max-width: 650px) {
	.navbar-content {
		padding: 0 0.5rem;
		gap: 0.25rem; /* Add small gap between sections */
	}

	.navbar-left,
	.navbar-right {
		flex: 0 0 auto; /* Don't allow flex grow/shrink */
	}

	.navbar-center {
		flex: 1 1 auto; /* Allow center to shrink */
		min-width: 0; /* Allow shrinking below content size */
	}

	.navbar-logo {
		width: 70px;
	}
}

@media (max-width: 480px) {
	:root {
		--navbar-height: 60px;
	}

	.navbar-content {
		padding: 0 0.5rem;
		gap: 0.25rem; /* Add small gap between sections */
	}

	.navbar-left,
	.navbar-right {
		flex: 0 0 auto; /* Don't allow flex grow/shrink */
	}

	.navbar-center {
		flex: 1 1 auto; /* Allow center to shrink */
		min-width: 0; /* Allow shrinking below content size */
	}

	.navbar-logo {
		width: 70px;
	}

	.player-info-area {
		gap: 0.5rem;
		justify-content: center;
		min-width: 0; /* Allow shrinking */
	}

	.player-avatar {
		width: 32px;
		height: 32px;
		font-size: 18px;
		flex-shrink: 0; /* Don't shrink avatar */
	}

	.player-nickname {
		font-size: 0.9rem;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		min-width: 0; /* Allow text to shrink */
	}

	.player-currency {
		padding: 0.3rem 0.6rem;
		gap: 0.3rem;
		flex-shrink: 0; /* Don't shrink currency */
	}

	.currency-icon {
		width: 18px;
		height: 18px;
	}

	.currency-amount {
		font-size: 0.8rem;
	}

	.leaderboard-btn {
		padding: 0.3rem 0.6rem;
		margin: 0 0.5rem;
		gap: 0.4rem;
		flex-shrink: 0;
	}

	.leaderboard-icon {
		font-size: 0.8rem;
	}

	.nickname-form {
		padding: 1.5rem;
		margin: 0.5rem;
	}

	.nickname-title {
		font-size: 1.25rem;
	}

	.nickname-subtitle,
	.nickname-tip {
		font-size: 0.9rem;
	}

	.avatar-grid {
		grid-template-columns: repeat(5, 1fr);
	}

	.avatar-option {
		width: 30px;
		height: 30px;
	}

	.avatar-emoji {
		font-size: 18px;
	}

	.selected-avatar-preview {
		width: 45px;
		height: 45px;
		font-size: 18px;
	}

	.lobby-container {
		margin: 0.5rem 0.25rem;
		padding: 0.75rem;
	}

	.lobby-buttons {
		flex-direction: column;
		gap: 0.5rem;
	}

	.lobby-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.quick-join-btn,
	.tutorial-btn {
		width: 100%;
		padding: 0.75rem 1rem;
	}

	.rooms-list th,
	.rooms-list td {
		padding: 0.5rem 0.25rem;
		font-size: 0.7rem;
	}

	.rooms-list button {
		padding: 0.3rem 0.6rem;
		font-size: 0.6rem;
		min-width: 40px;
	}

	.room-status {
		padding: 0.3rem 0.6rem;
		font-size: 0.6rem;
	}

	.player-nicknames {
		font-size: 0.6rem;
		max-width: 100px;
	}
}

@media (max-width: 350px) {
	.navbar-content {
		padding: 0 0.25rem;
		gap: 0.125rem;
	}

	.navbar-logo {
		width: 60px;
	}

	.player-info-area {
		gap: 0.25rem;
	}

	.player-avatar {
		width: 28px;
		height: 28px;
		font-size: 14px;
	}

	.player-nickname {
		font-size: 0.8rem;
		max-width: 80px; /* Limit nickname width */
	}

	.player-currency {
		padding: 0.25rem 0.5rem;
		gap: 0.25rem;
	}

	.currency-icon {
		width: 16px;
		height: 16px;
	}

	.currency-amount {
		font-size: 0.75rem;
	}

	.leaderboard-icon {
		font-size: 0.75rem;
	}
}

/* ================================
   ORIENTATION OVERLAY
   ================================ */
#orientation-overlay {
	display: flex;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	opacity: 0;
	background-color: rgba(0, 0, 0, 0.85);
	transition: opacity 250ms;
	pointer-events: none;
}

#orientation-overlay.visible {
	opacity: 1;
	pointer-events: unset;
}

#orientation-text {
	font-family: 'rubikBold';
	font-size: 3em;
	text-align: center;
	color: #eee;
	padding: 0 1em;
}

/* ================================
   NICKNAME SELECTION STYLES
   ================================ */
.nickname-container {
	position: fixed;
	user-select: none;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	backdrop-filter: blur(8px);
	background-color: rgba(0, 0, 0, 0.3);
	opacity: 1;
	transition: opacity 0.2s ease, backdrop-filter 0.2s ease;
}

.nickname-container.hiding {
	opacity: 0;
	backdrop-filter: blur(0px);
	pointer-events: none;
}

.nickname-form {
	background: white;
	padding: 2.5rem;
	border-radius: var(--border-radius);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
	width: 90%;
	max-width: 450px;
	text-align: center;
	animation: containerPop 0.5s ease-out forwards;
	position: relative;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.nickname-container.hiding .nickname-form {
	transform: scale(0.95) translateY(20px);
	opacity: 0;
}

.close-nickname-btn {
	position: absolute;
	top: 16px;
	right: 16px;
	background: none;
	border: none;
	color: #555;
	font-size: 28px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s;
	z-index: 10;
}

.close-nickname-btn:hover {
	color: #f48024;
}

@keyframes containerPop {
	0% {
		transform: scale(0.95);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.nickname-title {
	font-family: 'rubikBold', sans-serif;
	font-size: 1.75rem;
	color: var(--text-dark);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 1rem;
}

.nickname-subtitle {
	font-family: 'rubikRegular', sans-serif;
	font-size: 1.1rem;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}

.nickname-tip {
	font-family: 'rubikRegular', sans-serif;
	font-size: 1rem;
	margin-bottom: 1.5rem;
	color: var(--text-muted);
}

.nickname-input {
	width: 100%;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--border-radius);
	font-size: 1rem;
	background: var(--bg-light);
	color: var(--text-dark);
	transition: var(--transition);
}

.nickname-input:focus {
	border-color: var(--primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(244, 128, 36, 0.2);
}

/* Avatar Selection Styles */
.avatar-section {
	margin-bottom: 1.5rem;
}

.avatar-preview-section {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 1rem;
}

.selected-avatar-preview {
	width: 65px;
	height: 65px;
	border-radius: 50%;
	background-color: var(--bg-light);
	border: 3px solid var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 35px;
	cursor: pointer;
	user-select: none;
	transition: var(--transition);
}

.selected-avatar-preview:hover {
	transform: var(--transform);
	border-color: var(--primary-hover);
}

.change-avatar-btn {
	padding: 0.5rem 1rem;
	background-color: var(--accent);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
	font-family: 'rubikMedium', sans-serif;
	font-size: 0.9rem;
}

.change-avatar-btn:hover {
	background-color: var(--accent-hover);
	transform: translateY(-1px);
}

.avatar-grid-container {
	max-height: 200px;
	overflow-y: auto;
	transition: all 0.3s ease;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--border-radius);
	background-color: var(--bg-light);
}

.avatar-grid-container.collapsed {
	max-height: 0;
	overflow: hidden;
	border: none;
	padding: 0;
}

.avatar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
	gap: 0.5rem;
	padding: 1rem;
}

.avatar-option {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background-color: white;
	border: 2px solid transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: var(--transition);
	margin: 0 auto;
}

.avatar-option:hover {
	border-color: var(--primary);
	transform: var(--transform);
}

.avatar-option.selected {
	border-color: var(--primary);
	background-color: rgba(244, 128, 36, 0.1);
	transform: var(--transform);
}

.avatar-emoji {
	font-size: 28px;
	line-height: 1;
	cursor: inherit;
}

.nickname-submit {
	background: var(--primary);
	color: white;
	border: none;
	padding: 1rem 2.5rem;
	border-radius: var(--border-radius);
	font-size: 1rem;
	cursor: pointer;
	transition: var(--transition);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-family: 'rubikMedium', sans-serif;
	width: 100%;
}

.nickname-submit:hover {
	background: var(--primary-hover);
	transform: translateY(-2px);
}

/* ================================
   TUTORIAL STYLES
   ================================ */
.tutorial-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.75);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	font-family: 'rubikMedium', sans-serif;
}

.tutorial-content {
	width: 90%;
	max-width: 800px;
	height: 80%;
	max-height: 800px;
	background-color: #2a2f3f;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	animation: fadeIn 0.3s ease-in-out;
	transition: height 0.3s ease;
}

.tutorial-content.compact {
	height: auto;
	max-height: none;
}

.tutorial-header {
	padding: 20px;
	background-color: #1e2330;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.tutorial-header h1 {
	margin: 0;
	color: #fff;
	font-size: 24px;
}

.close-button {
	background: none;
	border: none;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	padding: 0 10px;
}

.tutorial-instruction {
	padding: 24px;
	background-color: #232837;
	color: #fff;
}

.tutorial-instruction h2 {
	margin: 0 0 10px;
	color: #4a90e2;
	font-size: 24px;
}

.tutorial-instruction p {
	margin: 0;
	line-height: 1.5;
	font-size: 24px;
}

.tutorial-game-area {
	flex: 1;
	background-color: #2a2f3f;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	min-height: 300px;
	transition: all 0.3s ease;
}

.tutorial-game-area.hidden {
	display: none !important;
	min-height: 0;
	padding: 0;
	flex: 0 0 0;
	height: 0;
	overflow: hidden;
}

.feedback-indicator {
	position: absolute;
	top: 7%;
	font-size: 55px;
}

.feedback-indicator.hidden {
	opacity: 0;
	visibility: hidden;
}

.correct-icon,
.wrong-icon {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	opacity: 0;
	transition: all 0.5s ease;
}

.correct-icon {
	color: #4caf50;
}

.wrong-icon {
	color: #f44336;
}

.correct-icon.visible,
.wrong-icon.visible {
	opacity: 1;
}

.items-container {
	user-select: none;
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 300px;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: visible;
}

.items-container.processing {
	pointer-events: none;
}

.items-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 15px;
	max-width: 800px;
	width: 100%;
}

.item {
	width: 120px;
	height: 120px;
	background-color: #3a4059;
	border-radius: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	margin: 5px;
}

@keyframes tutorialHighlight {
	0%,
	70%,
	100% {
		transform: scale(1);
	}
	80%,
	90% {
		transform: scale(1.1);
	}
}

.item.tutorial-highlight {
	animation: tutorialHighlight 3s ease-in-out infinite;
	animation-delay: 0.5s;
}

.item.correct-selection,
.item.wrong-selection {
	animation: none;
}

.item:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
	background-color: #4a4f69;
}

.item.processing {
	pointer-events: none;
	cursor: default;
	opacity: 0.8;
}

.item.correct-selection {
	border: 4px solid #4caf50;
	background-color: rgba(76, 175, 80, 0.2);
	animation: pulse-green 1s;
}

.item.wrong-selection {
	border: 4px solid #f44336;
	background-color: rgba(244, 67, 54, 0.2);
	animation: pulse-red 1s;
}

.item-image {
	width: 80px;
	height: 80px;
	object-fit: contain;
	cursor: pointer;
}

@keyframes pulse-green {
	0% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
	}
	70% {
		box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
	}
}

@keyframes pulse-red {
	0% {
		box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
	}
	70% {
		box-shadow: 0 0 0 15px rgba(244, 67, 54, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
	}
}

.item.fade-out {
	opacity: 0;
	transform: scale(0.8);
	transition: all 0.5s ease-out;
}

.restart-message {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	text-align: center;
	color: #f44336;
	font-size: 22px;
	font-weight: bold;
	background-color: rgba(0, 0, 0, 0.7);
	padding: 10px;
	border-radius: 5px;
	animation: fade-in 0.5s;
}

.tutorial-nav {
	padding: 15px 20px;
	background-color: #1e2330;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.nav-button {
	padding: 8px 20px;
	background-color: #4a90e2;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
	transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
	background-color: #3a80d2;
}

.nav-button:disabled {
	background-color: #6c7a8a;
	cursor: not-allowed;
	opacity: 0.7;
}

.step-indicators {
	display: flex;
	gap: 8px;
}

.step-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: #3c4050;
	transition: all 0.2s ease;
}

.step-dot.active {
	background-color: #4a90e2;
	transform: scale(1.2);
}

.step-dot.completed {
	background-color: #4caf50;
}

.completion-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 200px;
	padding: 20px;
	text-align: center;
}

#enterGameButton {
	margin: 30px auto;
	padding: 15px 40px;
	font-size: 24px;
	background-color: #4caf50;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: bold;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	text-transform: uppercase;
	display: block;
	width: auto;
	min-width: 200px;
}

#enterGameButton:hover {
	background-color: #45a049;
	transform: var(--transform);
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.completed-message {
	color: #4caf50;
	font-size: 28px;
	font-weight: bold;
	margin-bottom: 20px;
}

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

@keyframes appear {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.items-container.appearing {
	animation: appear 0.5s ease forwards;
}
