body {
	width: 100vw;
	height: 100vh;
	overflow: hidden;

	display: grid;
	grid-template-columns: 88px 1fr;
	grid-template-rows: 1fr;

	align-items: center;

	padding: 2%;

	background-color: black;

	color: aliceblue;
}

/* ROOOOOOMZ */

.room {
	grid-column: 2;
	grid-row: 1;
	justify-self: center;

	display: none;

	aspect-ratio: 442 / 285;
	width: min(80vw, calc(80vh * (442 / 285)));
	height: min(80vh, calc(80vw * (285 / 442)));

	background: url("room.png") center / contain no-repeat;

	grid-template-columns: 1fr 1fr 1fr;
	grid-template-rows: 1fr 1fr 1fr;

	user-select: none;
}

.room:target {
	display: grid;
}

/* Room Content */
.room-content {
	grid-row-start: 1;
	grid-column-start: 1;

	grid-row-end: 4;
	grid-column-end: 4;

	z-index: 2;

	display: grid;

	margin-left: 12%;
	margin-right: 12%;
	margin-top: 11%;

	aspect-ratio: 13 / 7;

	grid-template-columns: repeat(13, 1fr);
	grid-template-rows: repeat(7, 1fr);
}

.room-content input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.room-text {
	text-align: center;
	grid-row-start: 2;
	grid-row-end: 7;
	grid-column-start: 2;
	grid-column-end: 13;
	font-size: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.5);
}

.padestal {
	display: block;
	width: 100%;
}

#sword-padestal {
	grid-row-start: 4;
	grid-row-end: 7;
	grid-column-start: 6;
	grid-column-end: 9;

	z-index: 1;

	pointer-events: none;
}

#sword + label {
	display: block;

	grid-row-start: 4;
	grid-row-end: 7;
	grid-column-start: 6;
	grid-column-end: 9;

	cursor: pointer;
}

#sword + label > img {
	display: block;
	width: 100%;

	transform: rotate(180deg);
}

#sword:checked + label {
	opacity: 0;
	pointer-events: none;
}

.needs-sword {
	display: none;
}

.not-needs-sword {
	display: block;
}

body:has(#sword:checked) .needs-sword {
	display: block;
}

body:has(#sword:checked) .not-needs-sword {
	display: none;
}

#exit-room-trapdoor {
	grid-row-start: 3;
	grid-row-end: 6;
	grid-column-start: 6;
	grid-column-end: 9;
}

.keyroom-trapdoor {
	grid-row-start: 5;
	grid-row-end: 8;
	grid-column-start: 11;
	grid-column-end: 14;
}

.needs-keys {
	display: none;
}

.not-needs-keys {
	display: block;
}

body:has(#key-1:checked):has(#key-2:checked) .needs-keys {
	display: block;
}

body:has(#key-1:checked):has(#key-2:checked) .not-needs-keys {
	display: none;
}

.needs-key-1 {
	display: none;
}

/* .not-needs-key-1 {
	display: block;
} */

body:has(#key-1:checked) .needs-key-1 {
	display: block;
}

/* body:has(#key-1:checked) .not-needs-key-1 {
	display: none;
} */

.key-on-floor + label {
	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	justify-content: center;

	grid-row: 4;
	grid-column: 7;

	cursor: pointer;
}

.key-on-floor + label > img {
	display: block;
	width: 100%;

	transform: rotate(180deg);
}

.key-on-floor:checked + label {
	opacity: 0;
	pointer-events: none;
}

.needs-key-2 {
	display: none;
}

/* .not-needs-key-2 {
	display: block;
} */

body:has(#key-2:checked) .needs-key-2 {
	display: block;
}

/* body:has(#key-2:checked) .not-needs-key-2 {
	display: none;
} */

/* Slimes */
.slime + label {	
	cursor: url("sword.png") 31 10, auto;
	display: block;
	width: 100%;
	height: 100%;
}

.slime + label > img {
	display: block;
	width: 100%;
}

.slime:checked + label {
	opacity: 0;
	pointer-events: none;
}

.room-completed {
	display: none;
}

.room-not-completed {
	display: block;
}

#sd0:target:has(.slime:checked ~ .slime:checked) .room-completed {
	display: block;
}

#sd0:target:has(.slime:checked ~ .slime:checked) .room-not-completed {
	display: none;
}

#sd1:target:has(.slime:checked ~ .slime:checked ~ .slime:checked) .room-completed {
	display: block;
}

#sd1:target:has(.slime:checked ~ .slime:checked ~ .slime:checked) .room-not-completed {
	display: none;
}

#sd2:target:has(.slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked) .room-completed {
	display: block;
}

#sd2:target:has(.slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked) .room-not-completed {
	display: none;
}

#sd3:target:has(.slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked) .room-completed {
	display: block;
}

#sd3:target:has(.slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked ~ .slime:checked) .room-not-completed {
	display: none;
}

label[for="slime0"]  { grid-row: 3; grid-column: 11; }
label[for="slime1"]  { grid-row: 6; grid-column: 4; }
label[for="slime2"]  { grid-row: 2; grid-column: 1; }
label[for="slime3"]  { grid-row: 5; grid-column: 12; }
label[for="slime4"]  { grid-row: 1; grid-column: 8; }
label[for="slime5"]  { grid-row: 7; grid-column: 3; }
label[for="slime6"]  { grid-row: 4; grid-column: 5; }
label[for="slime7"]  { grid-row: 6; grid-column: 13; }
label[for="slime8"]  { grid-row: 2; grid-column: 9; }
label[for="slime9"]  { grid-row: 3; grid-column: 2; }
label[for="slime10"] { grid-row: 1; grid-column: 10; }
label[for="slime11"] { grid-row: 5; grid-column: 7; }
label[for="slime12"] { grid-row: 7; grid-column: 1; }
label[for="slime13"] { grid-row: 4; grid-column: 6; }

/* DAS PATATA RUUUUM */
#potatoes > .room-content > svg {
	width: 100%;
	height: auto;

	align-self: center;
	justify-self: center;
}

#potatoes > .room-content > :nth-child(1)  { grid-row: 5; grid-column: 7;  transform: rotate(327deg); }
#potatoes > .room-content > :nth-child(2)  { grid-row: 1; grid-column: 11; transform: rotate(189deg); }
#potatoes > .room-content > :nth-child(3)  { grid-row: 4; grid-column: 4;  transform: rotate(88deg); }
#potatoes > .room-content > :nth-child(4)  { grid-row: 1; grid-column: 2;  transform: rotate(14deg); }
#potatoes > .room-content > :nth-child(5)  { grid-row: 6; grid-column: 9;  transform: rotate(240deg); }
#potatoes > .room-content > :nth-child(6)  { grid-row: 6; grid-column: 2;  transform: rotate(131deg); }
#potatoes > .room-content > :nth-child(7)  { grid-row: 2; grid-column: 3;  transform: rotate(349deg); }
#potatoes > .room-content > :nth-child(8)  { grid-row: 3; grid-column: 1;  transform: rotate(174deg); }
#potatoes > .room-content > :nth-child(9)  { grid-row: 4; grid-column: 2;  transform: rotate(45deg); }
#potatoes > .room-content > :nth-child(10) { grid-row: 3; grid-column: 7;  transform: rotate(271deg); }
#potatoes > .room-content > :nth-child(11) { grid-row: 4; grid-column: 7;  transform: rotate(352deg); }
#potatoes > .room-content > :nth-child(12) { grid-row: 4; grid-column: 9;  transform: rotate(58deg); }
#potatoes > .room-content > :nth-child(13) { grid-row: 6; grid-column: 3;  transform: rotate(147deg); }
#potatoes > .room-content > :nth-child(14) { grid-row: 2; grid-column: 7;  transform: rotate(207deg); }
#potatoes > .room-content > :nth-child(15) { grid-row: 5; grid-column: 8;  transform: rotate(315deg); }
#potatoes > .room-content > :nth-child(16) { grid-row: 5; grid-column: 4;  transform: rotate(123deg); }
#potatoes > .room-content > :nth-child(17) { grid-row: 5; grid-column: 11; transform: rotate(26deg); }
#potatoes > .room-content > :nth-child(18) { grid-row: 6; grid-column: 6;  transform: rotate(78deg); }
#potatoes > .room-content > :nth-child(19) { grid-row: 4; grid-column: 13; transform: rotate(166deg); }
#potatoes > .room-content > :nth-child(20) { grid-row: 5; grid-column: 12; transform: rotate(356deg); }
#potatoes > .room-content > :nth-child(21) { grid-row: 4; grid-column: 11; transform: rotate(98deg); }
#potatoes > .room-content > :nth-child(22) { grid-row: 7; grid-column: 9;  transform: rotate(270deg); }
#potatoes > .room-content > :nth-child(23) { grid-row: 6; grid-column: 12; transform: rotate(51deg); }
#potatoes > .room-content > :nth-child(24) { grid-row: 1; grid-column: 9;  transform: rotate(219deg); }
#potatoes > .room-content > :nth-child(25) { grid-row: 3; grid-column: 8;  transform: rotate(35deg); }

#potato-recipe {
	grid-row: 5;
	grid-column: 5;
	cursor: pointer;
	color: aliceblue;
}

#potato-recipe:visited {
	color: aliceblue;
}

#potato-recipe:active {
	color: aliceblue;
}

#potato-recipe > svg {
	transform: rotate(295deg);
}

#potato-recipe:hover > svg {
	transform: scale(1.2) rotate(295deg);
}

#potato-recipe-site {
	z-index: 5;
	display: none;
	grid-column: 2;
	grid-row: 1;
	justify-self: center;

	width: 100%;
	height: 100%;
}

#potato-recipe-site > a {
	display: grid;
	width: 100%;
	height: 100%;
	
	grid-template-rows: 1fr;
	grid-template-columns: 1fr;

	align-items: center;
	justify-items: center;

	cursor: auto;
}

#potato-recipe-site > a:link {
	color: darkblue;
	text-decoration: none;
}

#potato-recipe-site > a:active {
	color: darkblue;
	text-decoration: none;
}

#potato-recipe-site > a:hover {
	color: darkblue;
	text-decoration: none;
}

#potato-recipe-site > a:visited {
	color: darkblue;
	text-decoration: none;
}

#potato-recipe-site > a > svg {
	display: block;
	height: 80vh;

	grid-row: 1;
	grid-column: 1;
}

#potato-recipe-site > a > article {
	display: flex;
	flex-flow: column nowrap;

	align-items: flex-start;
	justify-items: flex-start;

	height: 70vh;
	width: 40vh;
	
	grid-row: 1;
	grid-column: 1;

	font-size: 1.8vh;
}

#potato-recipe-site > a > article p {
	text-indent: 0.5em;
	line-height: 1.1;
}

#potato-recipe-site > a > article > *:last-child {
	display: flex;
	flex-flow: row nowrap;
	
	align-items: flex-end;
	justify-content: flex-start;

	margin-top: auto;

	gap: 1vh;
}


#potato-recipe-site:target {
	display: block;
}

body:has(#potato-recipe-site:target) #potatoes {
	display: grid;
	pointer-events: none;
}

/* map */
#map {	
	grid-row-start: 1;
	grid-row-end: 8;
	grid-column-start: 1;
	grid-column-end: 14;

	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	justify-content: center;
}

#map > table {
	border-collapse: separate;
	border-spacing: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05);
}

#map th {
	font-size: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.5);
}

.map-room {
	position: relative;
	width: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.8);
	aspect-ratio: 1 / 1;
	border: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.02) solid wheat;

	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	justify-content: center;
}

.map-room-bold {
	border: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05) solid yellowgreen;
}

.map-room p {
	display: block;
	font-size: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.4);
}

.map-door-l {
	position: absolute;
	left: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.02);
	top: 35%;
	width: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.02);
	height: 30%;
	background: red;
}

.map-room-bold .map-door-l {
	left: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.05);
	width: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05);
}

.map-door-r {
	position: absolute;
	right: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.02);
	top: 35%;
	width: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.02);
	height: 30%;
	background: red;
}

.map-room-bold .map-door-r {
	right: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.05);
	width: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05);
}

.map-door-t {
	position: absolute;
	top: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.02);
	left: 35%;
	height: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.02);
	width: 30%;
	background: red;
}

.map-room-bold .map-door-t {
	top: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.05);
	height: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05);
}

.map-door-b {
	position: absolute;
	bottom: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.02);
	left: 35%;
	height: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.02);
	width: 30%;
	background: red;
}

.map-room-bold .map-door-b {
	bottom: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * -0.05);
	height: calc(min(80vw, calc(80vh * (442 / 285))) * calc(1 - 0.24) / 13 * 0.05);
}

/* ITEMS */
#items {
	justify-self: start;
	grid-column: 1;
	grid-row: 1;

	text-shadow:
	1px 1px 2px black,
	-1px -1px 2px black,
	1px -1px 2px black,
	-1px 1px 2px black;
}

#items > ul {
	display: flex;
	flex-flow: column nowrap;

	align-items: center;
	justify-content: flex-start;


	width: calc(64px + 7px * 2 + 5px * 2);
	height: 80vh;

	gap: 30px;

	padding: 7px;
	
	background-color: #4d3324;
	border: 5px solid #31241e;

	overflow-x: hidden;
	overflow-y: scroll;

	list-style: none;
}

#items > ul > li > img {
	display: block;
}

#keys {
	height: 100%;
}

#keys > ul {
	list-style: none;
	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 5px;
}

#keys > ul > li > img {
	display: block;
}

/* Tooltips */
.tooltip {
	opacity: 0;
	pointer-events: none;
	display: inline-block;
	position: absolute;
	text-align: center;
	top: 0;
}

*:hover + .tooltip {
	opacity: 100;
	transition: 300ms;
}

.tooltip-owner {
	position: relative;
}

/* DOOOOOOOOORZ */
.trapdoor {
	z-index: 2;

	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	justify-content: center;
}

.trapdoor > a {
	width: 50%;
}

.trapdoor > a > img {
	width: 100%;
}

.trapdoor > a > .trapdoor-open {
	display: none;
}

.trapdoor > a > .trapdoor-closed {
	display: block;
}

.trapdoor > a:hover > .trapdoor-open {
	display: block;
}

.trapdoor > a:hover > .trapdoor-closed {
	display: none;
}

.door {
	z-index: 2;

	display: flex;
	justify-content: center;
}

.door > a > .door-open {
	display: none;
}

.door > a > .door-closed {
	display: block;
}

.door > a:hover > .door-open {
	display: block;
}

.door > a:hover > .door-closed {
	display: none;
}

.door > :is(a, img) {
	width: 32%;
}

.door img {
	display: block;
}

.door > a > img {
	width: 100%;
}

.door-hor {
	flex-flow: row nowrap;
}

.door-top {
	grid-column: 2;
	grid-row: 1;
	align-items: flex-start;
}

.door-bottom {
	grid-column: 2;
	grid-row: 3;
	align-items: flex-end;
}

.door-top > :is(a, img) {
	margin-top: 11%;
}

.door-bottom > :is(a, img) {
	transform: rotate(180deg);
	margin-bottom: 15%;
}

.door-ver {
	flex-flow: column nowrap;
}

.door-left {
	grid-column: 1;
	grid-row: 2;
	align-items: flex-start;
}

.door-right {
	grid-column: 3;
	grid-row: 2;
	align-items: flex-end;
}

.door-left > :is(a, img) {
	transform: rotate(270deg);
	margin-left: 7%;
}

.door-right > :is(a, img) {
	transform: rotate(90deg);
	margin-right: 10%;
}

#potatoes-door {
	height: 35%;
}

/* SVG */
.paper .st0 {
	fill:#F8D193;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}