:root {
	/* Backgrounds */
	--bg-0: #0b0e12; /* Midnight (app bg) */
	--bg-1: #1f2428; /* Stone (panels) */
	--surface-muted: #6f757a; /* Ash (borders / muted) */

	/* Text */
	--text-primary: #ede6d8; /* Parchment */
	--text-dark: #0b0e12; /* Midnight for light surfaces */

	/* Accents */
	--accent-primary: #e1b54b; /* Scoundrel Gold */
	--accent-cta: #d96a34; /* Ember */
	--accent-danger: #b74d3a; /* Blood Rust */
	--accent-nega: #7fb96a; /* Vile Green */

	/* Utility */
	--glass-01: rgba(255, 255, 255, 0.03);
	--glass-02: rgba(255, 255, 255, 0.06);
	--border: rgba(255, 255, 255, 0.06);
	--border-light: rgba(255, 255, 255, 0.2);
}

* {
	margin: 0;
	padding: 0;
}

body {
	background-color: var(--bg-0);
	width: 100vw;

	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

header {
	width: 100%;
	display: flex;
	flex-direction: column;
	row-gap: 6px;
	justify-content: space-between;
	padding: 12px 0px;

	border-bottom: 1px solid #333;

	max-width: 570px;
}

header .logo {
	margin-left: 12px;
}

header .logo h1 {
	letter-spacing: 6px;
	font-family: "New Rocker", system-ui;
	color: var(--text-primary);
}

header .logo h4 {
	color: var(--text-primary);
	text-decoration: underline;
}

header .nav {
	display: flex;
	flex-direction: row;
	align-items: center;
	margin-left: 12px;
}

header .nav a {
	background-color: rgba(0, 0, 0, 0);
	color: var(--accent-primary);
	outline: none;
	border: none;
	text-decoration: underline;
	font-size: 16px;
	font-family: "Times New Roman", Times, serif;
	cursor: pointer;
	padding-left: 6px;
}

header .nav button {
	background-color: rgba(0, 0, 0, 0);
	color: var(--accent-primary);
	outline: none;
	border: none;
	text-decoration: underline;
	font-size: 16px;
	font-family: "Times New Roman", Times, serif;
	cursor: pointer;
}

main {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;

	margin-top: 16px;
}

.dungeon-container {
	display: flex;
	flex-direction: row;
}

.dungeon-card-container {
	display: flex;
	flex-direction: column;
	row-gap: 6px;
}

.dungeon-card-container h3 {
	width: auto;
	padding-bottom: 3px;
	color: var(--accent-primary);
	text-align: center;
	border-bottom: 1px solid var(--accent-cta);
}

.room-container {
	display: flex;
	flex-direction: row;
	column-gap: 10px;

	padding: 0px 12px;
	min-width: 374px;
}

.card {
	width: 84px;
	height: 120px;
	border: 1px solid var(--border);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: #1f2428;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	cursor: pointer;
	user-select: none;
	inset: rgba(11, 14, 18, 0.5);
	color: var(--text-primary);

	font-size: 24px;
}

.card-top {
	font-size: 18px;
	font-weight: 600;
}

.card-sub {
	font-size: 12px;
	color: #555;
	margin-top: 8px;
}

.card.monster {
	border-color: var(--accent-nega);
}

.card.potion {
	border-color: var(--accent-danger);
}

.card.weapon {
	border-color: var(--accent-primary);
}

.player-container {
	display: flex;
	flex-direction: row;
	justify-content: space-between;

	margin-top: 12px;
	min-width: 570px;
}

.player-info-container {
	display: flex;
	flex-direction: column;
	row-gap: 6px;
}

.player-info-container h3 {
	width: auto;
	padding-bottom: 3px;
	color: var(--accent-primary);
	text-align: center;
	border-bottom: 1px solid var(--accent-cta);
}

.equipped-item-container {
	width: 100%;
}

.equipped-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.weapon-card {
	width: 84px;
	height: 120px;
	border: 1px solid var(--accent-primary);
	border-radius: 6px;
	background-color: #1f2428;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 24px;
	position: relative;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.weapon-card .card-badge {
	position: absolute;
	top: 8px;
	font-size: 16px;
	padding: 4px 6px;
	border-radius: 6px;
	background: var(--surface-muted);
	color: var(--text-primary);
	font-weight: 700;
}

.weapon-stack {
	position: relative;
	width: 84px;
	height: 120px;
	margin-left: 12px;
	pointer-events: none;
}

.weapon-stack .chip {
	position: absolute;
	top: 6px;
	left: 0;
	width: 84px;
	height: 120px;
	border-radius: 6px;
	background: var(--bg-1);
	color: var(--text-primary);
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	border: 1px solid var(--accent-nega);
	transform-origin: left center;
	transition:
		transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1),
		left 220ms;
	overflow: hidden;
}

.weapon-stack .chip .chip-rank {
	position: absolute;
	font-weight: 700;
	font-size: 14px;
	margin-left: 2px;
	color: var(--text-primary);
	pointer-events: none;
	line-height: 1;
}

.weapon-stack .chip .chip-rank--top {
	top: 6px;
	left: 6px;
	transform: none;
}

.weapon-stack .chip .chip-rank--bottom {
	bottom: 6px;
	right: 6px;
	transform: rotate(180deg);
}

.weapon-stack .chip.just-added {
	animation: chipIn 260ms cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}

@keyframes chipIn {
	from {
		transform: translateY(8px) scale(0.98);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.weapon-empty {
	width: 84px;
	height: 120px;
	color: var(--text-primary);
	font-size: 14px;
	border-radius: 6px;
	background: none;
	border: 1px dashed var(--border-light);

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.player-stats {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-width: 160px;
	text-align: center;
}

.player-stats .health-row {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
#health {
	font-weight: 800;
	color: var(--accent-nega); /* or var(--accent-primary) if preferred */
	font-size: 16px;
}

.player-stats span {
	color: var(--text-primary);
}

.player-health {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-wrap: wrap;
	max-width: 160px;
	margin-top: 6px;
}

.heart {
	width: 27px;
	height: 27px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: inline-block;
}

.moves-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 6px;
}

.move-token {
	width: 27px;
	height: 27px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: inline-block;
}

.moves-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 22px;
	padding: 0 6px;
	border-radius: 12px;
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.03),
		rgba(255, 255, 255, 0.02)
	);
	border: 1px solid var(--border-light);
	color: var(--text-primary);
	font-weight: 700;
	font-size: 13px;
}

.player-stats .row {
	margin-top: 6px;
	color: var(--text-primary);
}

.visually-hidden {
	position: absolute !important;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.game-controls {
	margin-top: 12px;
	margin-bottom: 12px;

	display: flex;
	flex-direction: row;
	column-gap: 6px;

	justify-content: center;
	align-items: center;
}

.hints {
	font-size: 13px;
	color: var(--text-primary);
}

#card-popover {
	position: absolute;
	z-index: 1200;
	background: var(--bg-1);
	border: 1px solid var(--border-light);
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	padding: 8px;
	display: flex;
	gap: 8px;
	color: var(--text-primary);
}
#card-popover.hidden {
	display: none;
}

.popover-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	appearance: none;
	border: 0;
	padding: 8px 14px;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	transition:
		transform 160ms cubic-bezier(0.2, 0.9, 0.25, 1),
		box-shadow 160ms cubic-bezier(0.2, 0.9, 0.25, 1),
		background-color 160ms;
	box-shadow: 0 6px 14px rgba(2, 6, 23, 0.06);
	color: var(--text-primary);
	background: linear-gradient(180deg, var(--bg-1), rgba(255, 255, 255, 0.02));
	border: 1px solid var(--accent-danger);
	padding-left: 12px;
	padding-right: 12px;
}
.popover-btn.primary {
	border-color: var(--accent-nega);
}

button:disabled .card.disabled {
	opacity: 0.45;
	pointer-events: none;
}

.modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, 0.45);
	z-index: 2000;
}

.modal.hidden {
	display: none;
}
.modal .modal-content {
	background: var(--bg-1);
	border: 1px solid var(--border-light);
	padding: 18px;
	min-width: 260px;
	text-align: center;
	color: var(--text-primary);
}

.modal-content h3 {
	font-size: x-large;
	font-family: "New Rocker", system-ui;
	text-decoration: underline;
	margin-bottom: 6px;
}

.modal .modal-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 12px;
}

.seed-options {
	display: flex;
	flex-direction: column;
	column-gap: 6px;

	margin-top: 6px;
}

.seed-options h4 {
	margin-bottom: 6px;
	text-decoration: underline;
}

.seed-options button {
	background-color: rgba(0, 0, 0, 0);
	color: var(--accent-primary);
	outline: none;
	border: none;
	text-decoration: underline;
	font-size: 16px;
	font-family: "Times New Roman", Times, serif;
	cursor: pointer;
	padding-left: 6px;
}

.seed-options span {
	margin-top: 6px;
}

.seed-input {
	background-color: var(--bg-1);
	color: var(--text-primary);
	border: 1px solid var(--border);
	outline: none;
}

.sr-only {
	position: absolute !important;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.info-label {
	font-size: 12px;
	color: #666;
	margin-left: 6px;
}

.default-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	appearance: none;
	border: 0;
	padding: 8px 14px;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	transition:
		transform 160ms cubic-bezier(0.2, 0.9, 0.25, 1),
		box-shadow 160ms cubic-bezier(0.2, 0.9, 0.25, 1),
		background-color 160ms;
	box-shadow: 0 6px 14px rgba(2, 6, 23, 0.06);
	color: var(--text-primary);
	background: linear-gradient(180deg, var(--bg-1), rgba(255, 255, 255, 0.02));
	border: 1px solid var(--accent-primary);
	padding-left: 12px;
	padding-right: 12px;
}

.footer {
	color: var(--text-primary);
}

.footer a {
	color: var(--accent-primary);
}