* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.game-container {
	position: fixed;
}

html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
	color: #fff;
	font-family: 'Courier New', monospace;
}

/* ---- Start form ---- */
#input-form {
	position: fixed;
	top: 45%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	z-index: 9999;
}

.formElement {
	width: 260px;
	height: 60px;
	font-family: inherit;
	font-size: 22px;
	font-weight: bold;
	text-align: center;
	color: #fff;
	background: rgba(13, 47, 79, 0.9);
	border: 2px solid #fff;
	border-radius: 4px;
	cursor: pointer;
}

input.formElement {
	cursor: text;
}

/* Left Panel */
.left-panel {
	position: absolute;
	display: flex;
	top: 20px;
	left: 20px;
	flex-direction: column;
	pointer-events: none;
}

.game-stats {
	display: none;
	position: relative;
	top: 0;
	left: 0;
	margin-top: 8px;
}

#minimap-container {
	position: relative;
	display: none;
	z-index: 1000;
	width: 300px;
	height: 300px;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.6);
	border-radius: 8px;
}

#minimap,
#minimap-canvas {
	position: absolute;

	/* canvas on top of image */
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	opacity: 0.9;
}

/* Right Panel */
.right-panel {
	position: absolute;
	display: flex;
	align-items: center;
	top: 20px;
	right: 20px;
	width: 220px;
	flex-direction: column;
	pointer-events: none;
}

/* Player List */
#players-panel {
	position: relative;
	z-index: 1200;
	width: 100%;
	height: 220px;
	max-height: 220px;

	background: rgba(13, 47, 79, 0.5);
	border: 2px solid rgba(255, 255, 255, 0.6);
	border-radius: 8px;
	padding: 10px 12px;
	color: white;
	font-family: 'VT323', monospace;
	font-size: 22px;
	/* won't block game input */
}

#players-panel .players-title {
	font-size: 24px;
	font-weight: bold;
	margin-bottom: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	padding-bottom: 6px;
	text-align: center;
}

#players-list {
	margin: 0;
	padding-left: 22px;
	list-style-position: outside;
	max-height: 170px;
	overflow: auto;
}

#players-list li {
	line-height: 18px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#gold-counter {
	position: relative;
	z-index: 1000;
	display: none;
	text-align: center;
	justify-content: center;
	width: 100%;
	gap: 6px;
	color: white;
	font-family: 'VT323', monospace;
	font-size: 22px;
	font-weight: bold;
	border: 1px solid #ffd700;
	border-radius: 4px;
	padding: 6px 12px;
	margin-top: 8px;
	background: rgba(13, 47, 79, 0.5);
}

/* Interaction Prompts */
#prompt-container {
	position: fixed;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
}

.prompt {
	background: rgba(13, 47, 79, 0.85);
	border: 1px solid #ffffff88;
	border-radius: 4px;
	padding: 6px 16px;
	font-size: 14px;
	pointer-events: none;
	white-space: nowrap;
}

/* Death Screen */
#death-screen {
	width: 100vw;
	height: 100vh;
	backdrop-filter: blur(10px);
	font-family: 'VT323', monospace;
	position: fixed;
	top: 45%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	gap: 12px;
	z-index: 9999;
}

#death-screen h1,
h2 {
	color: white;
	-webkit-text-stroke: 1px black;
}

#death-screen h1 {
	font-size: 5em;
}

#death-screen h2 {
	font-size: 3em;
}

#death-screen button {
	font-family: 'VT323', monospace;
	font-size: 2em;
	width: 5em;
	height: 2em;
}

/* Active Players Panel */
.vt323-regular {
	font-family: 'VT323', monospace;
}

/* Dig Minigame */
#dig-minigame {
	position: fixed;
	left: 50%;
	bottom: 80px;
	transform: translateX(-50%);
	z-index: 1500;
	width: 360px;
	pointer-events: none;
}

#dig-bar {
	position: relative;
	width: 100%;
	height: 24px;
	background: rgba(20, 20, 20, 0.9);
	border: 2px solid white;
	border-radius: 12px;
	overflow: hidden;
}

#dig-success-zone {
	position: absolute;
	top: 0;
	height: 100%;
	background: rgba(0, 200, 0, 0.75);
}

#dig-slider {
	position: absolute;
	top: -5px;
	width: 10px;
	height: 34px;
	background: white;
	border-radius: 4px;
	transform: translateX(-50%);
}

#dig-label {
	margin-top: 8px;
	text-align: center;
	color: white;
	font-size: 18px;
	font-family: 'VT323', monospace;
}

/* ---- Shop ---- */
#shop-menu {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2000;
	background: rgba(13, 47, 79, 0.97);
	border: 1px solid #fff;
	border-radius: 8px;
	padding: 20px;
	min-width: 640px;
	max-width: 90vw;
	max-height: 90vh;
	overflow-y: auto;
}

.shop-title {
	font-size: 18px;
	text-align: center;
	margin-bottom: 12px;
	border-bottom: 1px solid #ffffff55;
	padding-bottom: 8px;
}

.shop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 12px;
}

.shop-card {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid #ffffff44;
	border-radius: 4px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.shop-card-name {
	font-size: 12px;
	font-weight: bold;
	color: #aad4ff;
}

.shop-card-description {
	font-size: 11px;
	color: #ccc;
	flex: 1;
}

.shop-card-buy,
#shop-close-button {
	background: royalblue;
	color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	padding: 4px 8px;
	font-size: 11px;
	font-family: inherit;
	cursor: pointer;
}

.shop-card-level {
	font-size: 11px;
	color: #f5c542;
}

.shop-card-bottom-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.shop-card-cost,
.shop-card-benefit {
	font-size: 11px;
	color: #ffd700;
}

.shop-card-max {
	background: rgba(255, 255, 255, 0.1);
	color: #888;
	border-color: #555;
	cursor: default;
}

#shop-close-button {
	width: 100%;
	margin-top: 4px;
}

.shop-card-buy:hover,
.shop-close-button:hover {
	background: deepskyblue;
}
