/* World Map — ragnafever explorer ------------------------------------------ */

.rf-worldmap {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	position: relative;
}

.rf-worldmap-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.25rem;
	flex-wrap: wrap;
	padding: 1.25rem 1.5rem;
}

.rf-worldmap-title {
	margin: 0;
	font-size: 1.75rem;
	text-align: left;
}

.rf-worldmap-lead {
	margin: 0.75rem 0 0;
	max-width: 42rem;
}

.rf-worldmap-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-top: 0.85rem;
	font-size: 0.85rem;
	color: var(--rf-muted);
}

.rf-worldmap-meta span {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.rf-worldmap-meta span::before {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: var(--rf-primary);
	opacity: 0.85;
}

.rf-worldmap-stage-card {
	background: var(--rf-card);
	border: 1px solid var(--rf-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.rf-worldmap-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid var(--rf-border);
	background: rgba(255, 255, 255, 0.02);
}

.rf-worldmap-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	color: var(--rf-text);
	cursor: pointer;
	user-select: none;
}

.rf-worldmap-toggle input {
	accent-color: var(--rf-primary);
	width: 1rem;
	height: 1rem;
}

.rf-worldmap-hint {
	margin: 0;
	font-size: 0.82rem;
}

.rf-worldmap-stage {
	position: relative;
	width: 100%;
	overflow: hidden;
	background:
		radial-gradient(ellipse at center, rgba(249, 115, 22, 0.08), transparent 55%),
		#02040a;
	text-align: center;
	min-height: 220px;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.45s ease, transform 0.45s ease;
}

.rf-worldmap-stage.is-ready,
.rf-worldmap-stage.is-empty {
	opacity: 1;
	transform: none;
}

.rf-worldmap-stage.is-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
}

.rf-worldmap-stage::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
	z-index: 5;
}

.rf-worldmap-image {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

/* Field map icons ---------------------------------------------------------- */

.rf-map-icon {
	position: absolute;
	appearance: none;
	border: 0;
	background: rgba(0, 0, 0, 0.35);
	padding: 3px;
	margin: 0;
	border-radius: 12px;
	cursor: pointer;
	z-index: 10;
	transform: translate(-50%, -50%);
	transition:
		transform 0.18s ease,
		background 0.18s ease,
		box-shadow 0.18s ease,
		outline-color 0.18s ease;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.rf-map-icon:hover,
.rf-map-icon:focus-visible,
.rf-map-icon.is-active {
	transform: translate(-50%, -50%) scale(1.12);
	z-index: 25;
	background: rgba(249, 115, 22, 0.18);
	outline-color: rgba(249, 115, 22, 0.75);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.rf-map-icon img {
	display: block;
	image-rendering: pixelated;
	image-rendering: -moz-crisp-edges;
	image-rendering: crisp-edges;
	border-radius: 9px;
	border: 1px solid rgba(255, 255, 255, 0.16);
}

.rf-map-icon-label {
	position: absolute;
	top: 3px;
	left: 3px;
	background: rgba(4, 6, 13, 0.88);
	color: var(--rf-text);
	padding: 2px 4px;
	border-radius: 3px;
	font-size: 8px;
	line-height: 1.15;
	white-space: nowrap;
	pointer-events: none;
	z-index: 15;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	text-transform: lowercase;
	max-width: 90%;
	overflow: hidden;
	text-overflow: ellipsis;
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.rf-worldmap-hide-labels .rf-map-icon-label {
	display: none;
}

/* Mob detail panel --------------------------------------------------------- */

.rf-worldmap-panel {
	position: fixed;
	top: 0;
	left: 0;
	width: min(22rem, calc(100vw - 1.5rem));
	z-index: 10050;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.rf-worldmap-panel.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.rf-worldmap-panel-inner {
	background: rgba(10, 13, 24, 0.94);
	border: 1px solid var(--rf-border);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(12px);
	overflow: hidden;
}

.rf-worldmap-panel.is-pinned .rf-worldmap-panel-inner {
	border-color: rgba(249, 115, 22, 0.45);
	box-shadow:
		0 18px 40px rgba(0, 0, 0, 0.45),
		0 0 0 1px rgba(249, 115, 22, 0.18);
}

.rf-worldmap-panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--rf-border);
	background: rgba(255, 255, 255, 0.03);
}

.rf-worldmap-panel-id {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--rf-primary);
	line-height: 1.25;
	margin-bottom: 0.2rem;
}

.rf-worldmap-panel-title {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.78rem;
	color: var(--rf-muted);
	text-transform: lowercase;
	line-height: 1.25;
}

.rf-worldmap-panel-close {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--rf-muted);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.1rem 0.25rem;
	border-radius: 6px;
}

.rf-worldmap-panel-close:hover {
	color: var(--rf-text);
	background: rgba(255, 255, 255, 0.06);
}

.rf-worldmap-panel-body {
	max-height: min(50vh, 24rem);
	overflow: auto;
	padding: 0.35rem 0.35rem 0.35rem 0.55rem;
	overscroll-behavior: contain;
}

.rf-worldmap-panel-loading,
.rf-worldmap-panel-empty {
	padding: 1rem;
	text-align: center;
	color: var(--rf-muted);
	font-size: 0.88rem;
}

.rf-worldmap-mob-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rf-worldmap-mob {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0.55rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	font-size: 0.88rem;
}

.rf-worldmap-mob:last-child {
	border-bottom: none;
}

.rf-worldmap-mob.is-boss {
	background: rgba(248, 113, 113, 0.08);
	border-radius: 8px;
	border-bottom-color: transparent;
	margin: 0.15rem 0;
}

.rf-worldmap-mob-name {
	flex: 1;
	min-width: 0;
	color: var(--rf-text);
}

.rf-worldmap-mob-count {
	color: var(--rf-muted);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

.rf-worldmap-boss-badge {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.1rem 0.4rem;
	border-radius: 999px;
	background: rgba(248, 113, 113, 0.2);
	color: var(--rf-danger);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	vertical-align: middle;
}

.rf-worldmap-panel-foot {
	padding: 0.65rem 1rem;
	border-top: 1px solid var(--rf-border);
	font-size: 0.8rem;
	color: var(--rf-muted);
	min-height: 2.4rem;
}

/* Dungeon browser ---------------------------------------------------------- */

.rf-worldmap-dungeons {
	padding: 1.25rem 1.35rem 1.5rem;
}

.rf-worldmap-dungeons-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.15rem;
}

.rf-worldmap-dungeons-head .rf-card-title {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
}

.rf-worldmap-dungeons-head .rf-quest-muted-text {
	margin: 0;
}

.rf-worldmap-search {
	min-width: min(18rem, 100%);
}

.rf-worldmap-search input {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: 10px;
	border: 1px solid var(--rf-border);
	background: rgba(255, 255, 255, 0.04);
	color: var(--rf-text);
	font-size: 0.92rem;
}

.rf-worldmap-search input:focus {
	outline: none;
	border-color: rgba(249, 115, 22, 0.55);
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.rf-worldmap-search input::placeholder {
	color: var(--rf-muted);
}

.rf-dungeon-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.rf-dungeon-group {
	margin: 0;
	padding: 0;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid var(--rf-border);
	border-radius: 14px;
	overflow: hidden;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.rf-dungeon-group[open] {
	background: rgba(255, 255, 255, 0.035);
	border-color: rgba(249, 115, 22, 0.22);
}

.rf-dungeon-group-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem;
	padding: 0.85rem 1.05rem;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.rf-dungeon-group-summary::-webkit-details-marker {
	display: none;
}

.rf-dungeon-group-summary:hover {
	background: rgba(255, 255, 255, 0.03);
}

.rf-dungeon-group-summary:focus-visible {
	outline: 2px solid rgba(249, 115, 22, 0.65);
	outline-offset: -2px;
}

.rf-dungeon-group-name {
	color: var(--rf-text);
	font-size: 0.98rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.rf-dungeon-group-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	flex-shrink: 0;
}

.rf-dungeon-group-count {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--rf-muted);
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--rf-border);
	background: rgba(0, 0, 0, 0.22);
	font-variant-numeric: tabular-nums;
}

.rf-dungeon-group-chevron {
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid var(--rf-muted);
	border-bottom: 2px solid var(--rf-muted);
	transform: rotate(45deg);
	transition: transform 0.2s ease, border-color 0.2s ease;
	margin-top: -0.2rem;
}

.rf-dungeon-group[open] .rf-dungeon-group-chevron {
	transform: rotate(225deg);
	margin-top: 0.15rem;
	border-color: var(--rf-primary);
}

.rf-dungeon-maps {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
	gap: 0.7rem;
	padding: 0 1.05rem 1.05rem;
}

.rf-dungeon-map-icon {
	appearance: none;
	border: 1px solid var(--rf-border);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.55rem;
	padding: 0.55rem;
	margin: 0;
	border-radius: 12px;
	background: rgba(4, 6, 13, 0.55);
	cursor: pointer;
	text-align: left;
	color: inherit;
	transition:
		transform 0.18s ease,
		background 0.18s ease,
		border-color 0.18s ease,
		box-shadow 0.18s ease;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
	animation: rf-dungeon-tile-in 0.35s ease both;
	animation-delay: calc(var(--rf-dungeon-i, 0) * 28ms);
}

@keyframes rf-dungeon-tile-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.rf-dungeon-map-icon:hover,
.rf-dungeon-map-icon:focus-visible {
	transform: translateY(-2px);
	z-index: 2;
	background: rgba(249, 115, 22, 0.1);
	border-color: rgba(249, 115, 22, 0.45);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
	outline: none;
}

.rf-dungeon-map-icon.is-active {
	transform: translateY(-2px);
	z-index: 3;
	background: rgba(249, 115, 22, 0.16);
	border-color: rgba(249, 115, 22, 0.7);
	box-shadow:
		0 12px 24px rgba(0, 0, 0, 0.35),
		0 0 0 1px rgba(249, 115, 22, 0.25);
}

.rf-dungeon-map-thumb {
	position: relative;
	display: block;
	border-radius: 9px;
	overflow: hidden;
	background:
		linear-gradient(135deg, rgba(249, 115, 22, 0.12), transparent 55%),
		rgba(0, 0, 0, 0.35);
	aspect-ratio: 1;
}

.rf-dungeon-map-floor {
	position: absolute;
	top: 0.35rem;
	left: 0.35rem;
	z-index: 2;
	padding: 0.12rem 0.4rem;
	border-radius: 999px;
	background: rgba(4, 6, 13, 0.88);
	border: 1px solid rgba(249, 115, 22, 0.45);
	color: var(--rf-primary-strong);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	pointer-events: none;
}

.rf-dungeon-map-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	image-rendering: pixelated;
	image-rendering: -moz-crisp-edges;
	image-rendering: crisp-edges;
	border: 0;
	border-radius: 0;
}

.rf-dungeon-map-copy {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
	padding: 0 0.1rem 0.1rem;
}

.rf-dungeon-map-title {
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--rf-text);
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rf-dungeon-map-id {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.7rem;
	color: var(--rf-muted);
	text-transform: lowercase;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rf-worldmap-empty-search {
	margin: 1rem 0 0;
	text-align: center;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 900px) {
	.rf-worldmap-panel {
		width: min(22rem, calc(100vw - 1.5rem));
	}

	.rf-worldmap-panel-body {
		max-height: min(38vh, 16rem);
	}

	.rf-worldmap-dungeons-head {
		align-items: stretch;
	}

	.rf-worldmap-search {
		min-width: 100%;
	}

	.rf-dungeon-maps {
		grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	}
}

@media (max-width: 640px) {
	.rf-worldmap-header {
		padding: 1rem 1.1rem;
	}

	.rf-worldmap-title {
		font-size: 1.45rem;
	}

	.rf-worldmap-toolbar {
		padding: 0.75rem 0.9rem;
	}

	.rf-dungeon-group-summary {
		padding: 0.75rem 0.9rem;
	}

	.rf-dungeon-maps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding: 0 0.9rem 0.9rem;
		gap: 0.55rem;
	}

	.rf-dungeon-map-title {
		font-size: 0.78rem;
	}
}
