@import '/css/core.css';

@import '/css/elements/headings.css';
@import '/css/elements/main.css';

@import '/css/components/panel.css';

@import '/css/composites/quick-stats.css';

#game-wrapper {
	align-items: center;
	background-color: #000;
	display: flex;
	flex: 1;
	justify-content: center;
	position: relative;
	min-height: 0;
	min-width: 0;
	overflow: hidden;
}

#game-layout {
	display: grid;
	gap: 10px;
	grid-template-areas:
		'health health .'
		'canvas canvas canvas'
		'level experience-bar experience';
	grid-template-columns: auto 1fr auto;
	grid-template-rows: auto minmax(0, 1fr) auto;
	height: 100%;
	max-height: 100%;
	min-height: 0;
	min-width: 0;
	padding: 20px;
	width: fit-content;
	max-width: 100%;
}

#health-container {
	align-items: center;
	display: flex;
	gap: 10px;
	grid-area: health;
}

#health-container .label {
	color: #aaa;
	font-size: 12px;
}

#canvas-wrapper {
	grid-area: canvas;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	min-width: 0;
}

#game-canvas {
	border: 2px solid #333;
	width: 100%;
	height: 100%;
	image-rendering: -moz-crisp-edges;
	image-rendering: -webkit-crisp-edges;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
	object-fit: contain;
}

#notifications-container {
	position: absolute;
	top: calc(100% / 2 + 210px);
	left: 50%;
	transform: translateX(-50%);
	width: 600px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

#notifications-container > * {
	pointer-events: auto;
}

.stat-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 14px;
}

.stat-label {
	color: #aaa;
}

.stat-value {
	font-weight: bold;
	color: #fff;
}

.stat-button {
	background-color: #4caf50;
	color: white;
	border: none;
	padding: 2px 8px;
	cursor: pointer;
	font-size: 12px;
	margin-left: 8px;
	font-family: 'Courier New', monospace;
}

.stat-button:hover {
	background-color: #45a049;
}

.stat-button:disabled {
	background-color: #333;
	cursor: not-allowed;
	color: #666;
}

.controls-info {
	color: #aaa;
	display: flex;
	flex-direction: column;
	font-size: 12px;
	gap: 6px;
	line-height: 1.6;
}

ul.controls-info {
	padding-inline-start: 1em;
}

.key {
	background-color: #333;
	padding: 2px 6px;
	border-radius: 3px;
	color: #fff;
	font-weight: bold;
}

.alert-message {
	background-color: #ff5722;
	color: white;
	padding: 10px;
	border-radius: 4px;
	margin-bottom: 15px;
	font-size: 12px;
	text-align: center;
	animation: pulse 2s infinite;
}

.stat-points-notification {
	background-color: #4caf50;
	color: white;
	padding: 10px;
	border-radius: 4px;
	margin-bottom: 15px;
	font-size: 12px;
	text-align: center;
	font-weight: bold;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

.overlay-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: none;
	z-index: 99;
}

#pause-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: rgba(0, 0, 0, 0.9);
	padding: 30px 50px;
	border: 3px solid #4caf50;
	border-radius: 8px;
	text-align: center;
	display: none;
	z-index: 100;
}

#pause-overlay h1 {
	color: #4caf50;
	font-size: 32px;
	margin-bottom: 15px;
}

#pause-overlay p {
	color: #aaa;
	font-size: 14px;
	margin-bottom: 20px;
}

#start-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.95);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

#start-screen h1 {
	color: #4caf50;
	font-size: 48px;
	margin-bottom: 40px;
}

#color-selection-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.95);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

#color-selection-screen h1 {
	color: #4caf50;
	font-size: 48px;
	margin-bottom: 20px;
}

.variant-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 20px;
	margin-top: 20px;
	max-width: 600px;
}

.variant-button {
	background-color: #222;
	border: 2px solid #444;
	padding: 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}

.variant-button:hover {
	border-color: #4caf50;
	background-color: #333;
	transform: translateY(-2px);
}

.snake-preview {
	width: 60px;
	height: 60px;
	border: 2px solid #666;
	border-radius: 4px;
	background-color: #1a1a1a;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

.menu-button {
	background-color: #4caf50;
	color: black;
	border: none;
	padding: 12px 30px;
	font-size: 16px;
	cursor: pointer;
	font-family: 'Courier New', monospace;
	margin: 5px;
}

.menu-button:hover {
	background-color: #45a049;
}

.menu-button.secondary {
	background-color: #666;
}

.menu-button.secondary:hover {
	background-color: #555;
}

#game-over {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: rgba(0, 0, 0, 0.9);
	padding: 40px;
	border: 3px solid #ff5722;
	border-radius: 8px;
	text-align: center;
	display: none;
	z-index: 100;
}

#game-over h1 {
	color: #ff5722;
	font-size: 36px;
	margin-bottom: 20px;
}

#levelup-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: none;
	z-index: 99;
}

#levelup-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: rgba(0, 0, 0, 0.9);
	padding: 40px;
	border: 3px solid #4caf50;
	border-radius: 8px;
	text-align: center;
	display: none;
	z-index: 100;
	min-width: 400px;
}

#levelup-overlay h1 {
	color: #4caf50;
	font-size: 36px;
	margin-bottom: 15px;
}

#levelup-overlay p {
	color: #aaa;
	font-size: 16px;
	margin-bottom: 30px;
}

#upgrade-options {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 20px;
}

.upgrade-button {
	background-color: #2a2a2a;
	border: 2px solid #4caf50;
	color: white;
	padding: 20px;
	font-size: 16px;
	cursor: pointer;
	font-family: 'Courier New', monospace;
	text-align: left;
	transition: all 0.2s;
}

.upgrade-button:hover {
	background-color: #4caf50;
	transform: translateX(5px);
}

.upgrade-button .upgrade-name {
	display: block;
	font-size: 20px;
	font-weight: bold;
	color: #4caf50;
	margin-bottom: 8px;
}

.upgrade-button:hover .upgrade-name {
	color: white;
}

.upgrade-button .upgrade-description {
	display: block;
	font-size: 14px;
	color: #aaa;
}

.upgrade-button:hover .upgrade-description {
	color: white;
}

#countdown-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: none;
	z-index: 101;
}

#countdown-number {
	color: #4caf50;
	font-size: 120px;
	font-weight: bold;
	text-shadow: 0 0 30px rgba(76, 175, 80, 0.8), 0 0 60px rgba(76, 175, 80, 0.5);
	animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}
	50% {
		transform: scale(1.2);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

#first-move-overlay {
	animation: pulse 2s infinite;
	bottom: 20px;
	color: red;
	display: none;
	font-size: 18px;
	font-weight: bold;
	left: 50%;
	margin: 0;
	position: absolute;
	text-align: center;
	transform: translateX(-50%);
	z-index: 100;
}
