:root{
	--barColor: black;
	--percentage: 0%;
	--yScale: 1.109375;
}
body {
	position: relative;
}
.world.offline{
	filter: blur(20px);
}
.world .selected::after{
	content: '';
	position: absolute;
	left: var(--outline);
	top: var(--outline);
	bottom: var(--outline);
	right: var(--outline);
	border: 1px solid black;
	border-radius: 50%;
	z-index: 1;
	--outline: -3px;
	opacity: 1;
	box-shadow: 0px 0px 9px 7px #ad0505;
}
.world .target{
	outline: 2px solid gold;
}
.world{
	z-index: 0;
	--size: 32;
	--tilesSize: 256px;
	--map_x: 5;
	--map_y: 5;
	--width: calc(var(--map_x) * var(--tilesSize));
	--height: calc(var(--map_x) * var(--tilesSize));
	--sky: black;
	min-width: calc(var(--width) * 1px);
	min-height: calc(var(--height) * 1px);
	max-width: calc(var(--width) * 1px);
	max-height: calc(var(--height) * 1px);
	width: calc(var(--width) * 1px);
	height: calc(var(--height) * 1px);
	
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	overflow: visible;
	background-color: silver;
}
.world.night {
	--sky: black;
}

.nightOverlay rect {
	transition: fill 2s ease; /* plynulý přechod dne/noci */
}
.layer-ground,
.layer-path,
.layer-object,
.layer-undead,
.layer-wood {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none; /* Zajistí, že vrstvy samy o sobě nereagují na klik */
}
/* Každá vrstva může mít své pořadí */
.layer-ground { z-index: 1; }
.layer-path   { z-index: 2; }
.layer-undead { z-index: 3; }
.layer-object { z-index: 4; }
.layer-wood { z-index: 4; }
.layer-ground > div,
.layer-path > div,
.layer-object > div, 
.layer-undead > div,
.layer-wood > div {
	position: absolute;
	left: calc(var(--tilesSize) * var(--x) - var(--tilesSize));
	top: calc(var(--tilesSize) / 4 * var(--y) - var(--tilesSize) / 2);
	width: var(--tilesSize);
	height: var(--tilesSize);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100%;
	z-index: calc(var(--y) * 100 + var(--x)); /* pro překrývání dlaždic */
}
.world{
	/*display: grid;
	grid-template-columns: repeat(var(--map_x), var(--tilesSize));
	grid-template-rows: repeat(var(--map_y), var(--tilesSize));*/
	background-color: #182e1d;
	z-index: 1;
	--tileSize: 256;
}
.world .layer-world > div:is([data-type="item"]), .item.placing-entity-ghost {
	--size: 32;
	overflow: hidden;
	box-shadow: 4px 3px 7px #0000008c;
	border-radius: 50%;
	background-image: url('/img/ui/frame/Background_r_grey.png');
	padding: 7px;
}
.world .layer-world > div:is([data-type="item"])::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	background-image: url('/img/ui/frame/Round_fr.png');
	background-size: cover;
	z-index: 1;
}
.world .layer-world > div:is([data-type="player"]) {
	
}
.world .layer-world > div[data-type]{
	--subOffset: 0;
	z-index: calc(var(--y) * 1000 + var(--x) * 100 + var(--zOffset, 0)  + var(--subOffset));
}
.world .layer-world > div:not([data-type]){
	--width: var(--tilesSize);
	--height: var(--tilesSize);
	position: absolute;
	width: calc(var(--width));
	height: calc(var(--height));
	
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100%;
	
	/* Přepočet pro izometrický grid */
	--_x: calc(var(--tileSize) * var(--x) - var(--tileSize));
	--_y: calc(var(--tileSize) * var(--yScale) / 4 * var(--y) - var(--tileSize) / 2);
	
	
	--tileHeight: calc(var(--tileSize) * var(--yScale) / 4);
	
	left: calc(var(--_x) * 1px);
	top: calc(var(--_y) * 1px);
	--isoX: calc((var(--_x) + var(--tileSize)) / var(--tileSize));
	--isoY: calc((var(--_y) + var(--tileHeight)) / var(--tileHeight));
	--subOffset: 0;
	z-index: calc(var(--isoY) * 1000 + var(--isoX) * 100 + var(--subOffset));
	/*z-index: calc((var(--y) + 1) * 10 + var(--x) * 10) //originál původní*/

}
.other-player{
	
}
.worldWindow{
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	background-color: black;
	z-index: 0;
}
.world{
	/*min-width: calc(var(--width) * 1px);
	min-height: calc(var(--height) * 1px);
	max-width: calc(var(--width) * 1px);
	max-height: calc(var(--height) * 1px);
	width: calc(var(--width) * 1px);
	height: calc(var(--height) * 1px);/*
	position: absolute;
}
.world{
	z-index: 2;
	/*background-color: #7B9C45;*/
	
}
.tile-visual {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  pointer-events: none; /* jen vizuální – neklikací */
}

.world [class*="layer-"] > div[data-type]:not([data-type="player"]):not([data-type="npc"]), .item.placing-entity-ghost{
	position: absolute;
	left: calc(var(--_x)* 1px);
	top: calc(var(--_y)* 1px);
	width: calc(var(--size)* 1px);
	height: calc(var(--size)* 1px);
	font-size: 10px;
	transform: translate(-50%, -50%);
}
.world .map-entity-placed{
	opacity: .5;
}
.world [class*="layer-"] > :is([data-type="player"]) {
	--size: 48;
	color: white;
	display: flex;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
	background-color: transparent;
	border-radius: 50%;
	width: calc(var(--size)* 1px);
	height: calc(var(--size)* 1px);
	transform: translate(-50%, -50%) translate3d(calc(var(--_x) * 1px), calc(var(--_y) * 1px), 0px);
}
.world [data-type="npc"] {
	position: absolute;
	left: calc(var(--_x)* 1px);
	top: calc(var(--_y)* 1px);
}
[data-type="block"]::before{
	background-color:rgba(255, 0, 0, 0.229);
}
/*.world [class*="layer-"] > div[data-type]::before{
	content: '';
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	position: absolute;
	background-image: var(--ico);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-position: center;
	border-radius: 50%;
}*/
[data-type="npc"] {
	--x: 100;
	--y: 25;
	
}

.health{
	--barColor: #d51c00;
}
.mana{
	--barColor: #126F9C;
}
.endurance{
	--barColor: #C5A74A;
}
.bar, .hudItem{
	z-index: 2;
	color: white;
	border: 2px solid #392E2B;
	border-radius: 2px;
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: 0px 1px 3px 1px black;
	box-sizing: border-box;
	background-color: #181213;
	position: relative;
}
.hudActions{
	--size: 32px;
}
.hudItem{
	width: var(--size);
	height: var(--size);
}
.hudItem:hover::before{
	box-shadow: 0 0 5px 0 #ffb200;
}
.hudItem::before{
	content: '';
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	position: absolute;
	background-image: var(--ico);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-position: center;
	
}
:is(.hudItem, .hudItem:hover):is(.noTarget, .cooldown)::before{
	opacity: .8;
	filter: grayscale(1);
	box-shadow: none;
}
.lineBar{
	width: 200px;
	background-image: linear-gradient(to right, var(--barColor) var(--percentage), transparent var(--percentage));
	font-size: 10px;
	height: 16px;
}
.lineBar::before{
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: var(--percentage);
	box-shadow: inset 0px -5px 9px #0000008a;
}
.bar.log{
	position: fixed;
	left: 25px;
	bottom: 25px;
	width: 400px;
	height: 200px;
	overflow: scroll;
	opacity: .7;
}
.playerHud{
	position: fixed;
	top: 25px;
	left: 25px;
	--width: 300px;
	width: var(--width);
	filter: drop-shadow(0px 2px 11px rgba(50, 50, 0, 1));
	z-index: 1;
}
.playerHud .heroIco{
	position: relative;
	z-index: 2;
	width: calc(var(--width) / 100 * 35);
	padding: calc(var(--width) / 100 * 2.2);
}
.hudLevelInfo, .hudClassInfo{
	background-image: url(/img/ui/hud/little_round_frame2.png);
	aspect-ratio: 1 / 1;
	width: calc(var(--width) / 100 * 9);
	position: absolute;
	top: 13%;
	left: 30%;
	z-index: 3;
	background-size: contain;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: calc(var(--width) / 100 * 4);
}
.classIco{
	display: flex;
}
.classIco img{
	width: 100%;
}
.hudClassInfo{
	left: 1%;
	top: 76%;
}
.hudInfoBar{
	display: flex;
	gap: 0;
	flex-direction: column;
	background-image: url(/img/ui/hud/basic_bar2.png);
	width: calc(var(--width) / 100 * 88);
	background-size: contain;
	aspect-ratio: 1024 / 258;
	z-index: 1;
	position: absolute;
	top: 31%;
	left: 13%;
	background-repeat: no-repeat;
	
}
.hudBars{
	position: absolute;
	top: 48%;
	left: 38%;
	right: 6%;
	z-index: 4;
	font-size: calc(var(--width) / 100 * 4);
	display: flex;
	flex-direction: column;
	gap: calc(var(--width) / 100 * .1);
}
.hudBars > div{
	background-image: url(/img/ui/hud/long_line2.png);
	aspect-ratio: 2048 / 256;
	background-size: contain;
	background-repeat: no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.hudBars > div::before, .xpBar::before{
	content: '';
	position: absolute;
	top: 4%;
	bottom: 8%;
	left: 1%;
	width: calc(99% / var(--max) * var(--current));
	background-size: 100% 100%;
	background-repeat: no-repeat;
	z-index: 1;
}
.hudBars > div > div{
	z-index: 2;
}
.xpBar{
	background-image: url(/img/ui/abilites_bar/xp_background.png);
	position: fixed;
	left: 50%;
	aspect-ratio: 2048 / 64;
	bottom: 8px;
	background-position: center;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 460px;
	transform: translateX(-50%);
	box-shadow: 0 2px 5px black;
	max-width: calc(100% - 140px);
	
	
}
.xpBar::before{
	position: absolute;
	background-image: url(/img/ui/abilites_bar/xp_line.png);
	top: 0;
	bottom: 0;
	left: 0;
	width: calc(100% / var(--max) * var(--current));
	background-repeat: no-repeat;
	z-index: 1;
}
.xpBar::after{
	background-image: url(/img/ui/abilites_bar/xp_bar.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	content: '';
	position: absolute;
	z-index: 1;
}
.xpBar > div{
	z-index: 2;
	font-size: 10px;
}
.hudBarHealth::before{
	background-image: url(/img/ui/hud/Hp_line.png);
}
.hudBarMana::before{
	background-image: url(/img/ui/hud/Mana_line.png);
}
.hudBarEndurance::before{
	background-image: url(/img/ui/hud/energy_line.png);
}
.hudName{
	position: absolute;
	top: 35%;
	left: 37%;
	right: 6%;
	z-index: 4;
	font-size: calc(var(--width) / 100 * 4);
	height: 11%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.targetHud{
	text-align: left;
	margin: 0;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	padding: 5px;
	position: fixed;
	gap: 5px;
	top: 25px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
}
[data-quantity]:not([data-quantity="1"])::after{
	content: attr(data-quantity);
	color: white;
	z-index: 1;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 2px;
	font-size: calc(var(--size)* .34375);
}
.playerHud .name{
	font-size: 12px;
}
.hud{
	display: flex;
	justify-content: space-around;
	margin-bottom: 20px;
}

.hudActions {
	display: flex;
	justify-content: center;
	gap: 10px;
	position: fixed;
	bottom: 25px;
	left: 50%;
	gap: 4px;
	transform: translateX(-50%);
}

.action-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	background-color: #008cba;
	color: white;
	text-decoration: none;
	font-weight: bold;
	border-radius: 8px;
	position: relative;
}
.hud-action{
	position: relative;
}
.cooldown-timer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: bold;
	color: white;
	border-radius: 8px;
	opacity: 0;
}

.cooldown .cooldown-timer {
	opacity: 1;
}

.preparing {
	background-color: #ff9800 !important;
	cursor: wait;
}

.tile-block{
	background-color: transparent;
}

.destination-marker {
	position: absolute;
	width: 12px;
	height: 12px;
	background: red;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	z-index: 100000000000000000000000000000000000000000000000;
	pointer-events: none;
	box-shadow: 0 0 4px rgba(255,0,0,0.8);
}
.player {
	position: absolute;
	width: var(--tilesSize);
	height: calc(var(--tilesSize) / 4);
	background: url('/img/player.png') center center no-repeat;
	background-size: contain;
	transform: translate(-50%, -50%) translate3d(calc(var(--_x) * 1px), calc(var(--_y) * 1px), 0px);
	z-index: 1000;
	pointer-events: none;
	background-color: red;
}
.uiNPC{
	width: 50px;
	position: relative;
	display: flex;
	height: 100px;
	justify-content: center;
	--progressColor: yellow;
}
/*.uiNPC .visual::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--detection-radius) * 2px);
	height: calc(var(--detection-radius) * 2px);
	border-radius: 50%;
	border: 3px dashed rgba(255, 0, 0, 0.5);
	transform: translate(-50%, -50%) rotateX(50deg);
	pointer-events: none;
	background-color: #ff000017;
}*/
.uiNPC.placing-entity-ghost, .world .uiNPC{
	transform: translate(-50%, -75%);
}
.uiNPC img{
	max-width: 100%;
}
.uiNPC > .visual{
	position: absolute;
	transform-origin: center center;
	display: flex;
	bottom: 7px;
	width: 45px;
	z-index: 3;
}

.uiNPC::before{
	content: "";
	position: absolute;
	width: 50px;
	height: 50px;
	background-image: url('/img/ui/hero_ico/Hero_icon_frame.png'), radial-gradient(#00000070, #000000ad);
	background-size: 100%;
	background-repeat: no-repeat;
	border-radius: 50%;
	transform: rotateX(50deg) translateY(-16px) rotate(180deg);
	transform-origin: center center;
	bottom: -17px;
	box-shadow: 0 -3px 10px #000000;
	z-index: 1;
}

.uiNPC.atAttention::after {
	content: "";
	position: absolute;
	width: 3px;
	height: 45px;
	background: black linear-gradient(to top, var(--progressColor) var(--progress, 0%), transparent 0%);
	bottom: 12px;
	pointer-events: none;
	z-index: 2;
	opacity: .7;
	left: calc(100% + 5px);
}
/*.uiNPC::after {
	content: "";
	position: absolute;
	width: 50px;
	height: 50px;
	background: conic-gradient(var(--progressColor) var(--progress, 0%), transparent 0%);
	border-radius: 50%;
	mask-image: radial-gradient(closest-side, black 95%, transparent 100%);
	transform: rotateX(50deg) translateY(-16px);
	transform-origin: center center;
	bottom: -17px;
	pointer-events: none;
	z-index: 2;
	opacity: .7;
}*/

.abilitesBar{
	position: fixed;
	bottom: 10px;
	width: 540px;
	height: 90px;
	padding: 10px;
	left: 50%;
	transform: translateX(-50%);
}


.menuBar{
	position: fixed;
	right: 10px;
	bottom: 10px;
	display: flex;
	gap: 2px;
	z-index: 1;
}

.nightOverlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 9999;
}
.nightOverlay svg {
	width: 100%;
	height: 100%;
	display: block;
}
.layer-world{
	position: relative;
	z-index: 1;
}


.layer-weather {
	position: fixed; /* aby déšť nebyl vázán na pohyb mapy */
	pointer-events: none;
	z-index: 9998;
	left: 0;
	right: 0;
	bottom: 0;
	top: 0;
	overflow: hidden;
}

.raindrop {
	position: absolute;
	width: 2px;
	height: 15px;
	background: rgba(200, 200, 255, 0.9);
	animation: rainFall 1s linear infinite;
}

@keyframes rainFall {
	0% {
		transform: translateY(-50px) translateX(-20px);
		opacity: 1;
	}
	10% {
		opacity: 1;
	}
	100% {
		transform: translateY(1000px) translateX(280px);
		opacity: 0;
	}
}

.world .npc{
	--shadowColor1: rgba(0, 200, 0, 0);
	--shadowColor2: rgba(0, 200, 0, 0);
	transition: all .6s;
}
.world .npc--nearby {
	--shadowColor1: rgba(255, 200, 0, 1);
	--shadowColor2: rgba(255, 200, 0, 0.5);
	transform: translate(-50%, -75%);
	filter: drop-shadow(0 0 2px var(--shadowColor1)); 
}
.world .npc--nearbyvery {
	--shadowColor1: rgba(255, 0, 0, 1);
	--shadowColor2: rgba(255, 0, 0, 0.5);
	transform: translate(-50%, -75%);
	filter: drop-shadow(0 0 3px var(--shadowColor1)); 
}
@media screen and (max-width: 1100px) {
	.menuBar {
		flex-direction: column;
	}
}

.npcProgressRing {
	--progress: 0%;
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--size);
	height: var(--size);
	border-radius: 50%;
	border: 3px solid yellow;
	mask: conic-gradient(from 0deg, yellow var(--progress), transparent 0);
	pointer-events: none;
	--size: 16px;
	transform: translateX(-50%);
}

.playerProgressArrow {
	width: 8px;
	height: 8px;
	position: absolute;
	transform-origin: center center;
	transform: translate(-50%, -50%) rotate(0deg);
	clip-path: polygon(50% 0%, 100% 100%, 50% 100%, 0% 100%);
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
	opacity: 0.8;
	pointer-events: none;
}

#playerUIArrows {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
#battleWindow{
	inset: 0;
	position: absolute;
	backdrop-filter: blur(15px);
	background-color: #0000006b;
}

