:root {
	--lightcolor: lightgray;
	--darkcolor: black;
	--linkcolor: #666;
	--bordercolor: #333;
	--border: 3px solid var(--bordercolor);
	--displayfont: 'inter', sans-serif;
	--regularfont: 'inter', sans-serif;
	--radius: 15px;
	--margin: 10px;
}



/************************************ FONTS ************************************************/
@font-face {font-family: 'inter'; src: url("fonts/inter-variable.ttf"); font-style: normal; font-display: swap;}
@font-face {font-family: 'inter'; src: url("fonts/inter-italic-variable.ttf"); font-style: italic; font-display: swap;}



/************************************ RESET ************************************************/
* {margin: 0; padding: 0; border: 0; box-sizing: border-box; text-decoration: none;}



/************************************ BODY ************************************************/
html {font-family: var(--regularfont); font-size: large; line-height: 1.33lh; color: var(--lightcolor); background: var(--darkcolor); position: relative; scroll-behavior: smooth; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--lightcolor) var(--darkcolor);}
body {min-height: calc(100vh - 100px); padding: 0 var(--margin) var(--margin); background: url("images/background.png") no-repeat center center var(--darkcolor); background-size: cover; background-attachment: fixed; overflow-x: hidden; box-shadow: 0 0 25vw black inset;}
a, a img, video, .popup, .cards div {transition: .15s ease-out;}



/************************************ HEADER ************************************************/
header {width: max-content; margin: 0 auto 50px; border: var(--border); border-top: 0; border-radius: 0 0 20px 20px; background: var(--darkcolor); position: relative; user-select: none; z-index: 10;}
header a {display: block; perspective: 200px; padding: 20px;}
header a img {display: block; width: 60px; height: auto; margin: auto; fill: var(--lightcolor); transition: .6s ease-out;}
header a:hover img {transform: rotateY(-180deg);}



/************************************ MENU ************************************************/
@media (min-width: 900px) {
	nav {display: flex; font-size: small; text-transform: uppercase; text-align: center; font-weight: bold; color: var(--lightcolor); user-select: none; line-height: 50px;}
	
	.menu_toggle {display: none;}
	
	.menu_container ul {display: flex; flex-direction: column; position: fixed; width: 50px; overflow: visible; top: 50%; transform: translateY(-50%); display: flex; justify-content: center;}
	.menu_container li {list-style: none;}
	.menu_container a {display: block; white-space: nowrap; padding: 25px 0; margin: 0; letter-spacing: .33em; writing-mode: vertical-lr; color: var(--linkcolor);}
	.menu_container a:hover {color: var(--lightcolor); background: var(--bordercolor);}
	.menu_container a.current {color: var(--darkcolor); background: var(--lightcolor);}
	.menu_container span {padding: 0;}
	.menu_container .navigation {left: 0; transform-origin: top left;}
	.menu_container .navigation a {transform: rotate(180deg);}
	.menu_container .language {right: 0; top: 50%; transform-origin: top right;}
}



/************************************ MOBILE MENU ************************************************/
@media (max-width: 900px) {
	nav {display: block; font-family: var(--displayfont); font-size: larger; color: var(--lightcolor);}

	.menu_toggle {position: absolute; top: var(--margin); right: var(--margin); z-index: 200; cursor: pointer; background: none;}
	.menu_toggle img:first-child {display: block;}
	.menu_toggle img:last-child {display: none;}
	.menu_toggle.opened img:first-child {display: none;}
	.menu_toggle.opened img:last-child {display: block;}

	.menu_container {display: none; grid-template-rows: 0fr; margin-bottom: 50px; overflow: hidden;}
	.menu_container.opened {display: grid;}
	.menu_container a {display: block; padding: 20px; border: 3px solid #2D2D2D; border-radius: var(--radius); font-size: 1.5rem; font-weight: bold; text-align: center; color: currentColor; background: var(--darkcolor); overflow: hidden; cursor: pointer;}
	.menu_container a:hover {color: white;}
	.menu_container a.current {color: var(--darkcolor); background: var(--lightcolor);}
	.menu_container a.current:hover {color: var(--darkcolor); background: white;}
	.menu_container .navigation {display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px;}
	.menu_container .language {display: grid; grid-template-columns: 1fr 1fr; gap: 8px;}
	.menu_container .language a {font-size: 1.25rem;}
}



/************************************ MAIN ************************************************/
main {max-width: 1080px; margin: 0 auto;}
main.home {max-width: 1350px;}

aside {max-width: 800px; margin: 100px auto;}

h1 {font-family: var(--displayfont); font-size: 1.8rem; margin-bottom: 30px; line-height: .95; font-weight: 800; text-wrap: balance; text-transform: uppercase;}
h2 {font-family: var(--displayfont); font-size: 1.8rem; margin-bottom: 30px; line-height: 1.1; font-weight: 800; text-wrap: balance;}
h2.block {max-width: 18em; margin-bottom: 0;}
h3 {font-family: var(--displayfont); font-size: 1.5rem; margin-bottom: 20px; line-height: 1.4lh; font-weight: 800;}

h1:only-child, h2:only-child {margin-bottom: 0;}

hgroup {margin-bottom: 50px;}
hgroup h1 {margin-bottom: 10px; font-size: xxx-large; margin: 0 auto 20px; line-height: .85em; text-align: center;}
hgroup p {text-align: center; font-size: larger; line-height: 1.4em;}

.block {padding: 30px; margin: var(--margin) 0; border-radius: var(--radius); color: var(--darkcolor); background: var(--lightcolor); overflow: hidden;}
.block p:not(:last-child) {margin-bottom: 20px;}
.block h2 + p {border-top: var(--border); padding-top: 20px;}
.block strong {font-weight: 800;}
.block small {font-size: 10px;}
.block a {color: currentcolor; text-decoration: underline; cursor: pointer;}
.block a:hover {color: var(--linkcolor);}
.block del {text-decoration: line-through;}
.block ul {margin-left: 1.5em; list-style: "— ";}
.block > img:first-child {display: block; width: calc(100% + 60px); margin: -30px 0 30px -30px; height: auto; border: 0; border-radius: 0;}
.block .button {display: block; width: max-content; padding: 0 10px; margin: 15px 0 0 auto; border: 3px solid; border-radius: 15px; text-decoration: none; font-size: smaller; font-weight: bold;}
.block .button:hover {color: white; border-color: var(--darkcolor); background: var(--darkcolor);}
li.block {text-wrap: balance;}

.game_data {display: grid; gap: var(--margin); margin-bottom: 100px;}

.game_image {display: block;}
.game_image img {display: block; width: 100%; height: auto; border: var(--border); border-radius: var(--radius); background: var(--darkcolor) !important;}

.game_credits {align-self: flex-start;}
.game_credits .block:first-child {width: 75%; min-width: min-content; margin-top: 0;}
.game_credits dl {display: grid; grid-template-columns: auto 1fr; gap: 0 20px; font-size: .9rem; line-height: 1lh;}
.game_credits dt {font-weight: bold;}
.game_credits a {text-decoration: underline;}
.game_credits img {display: block; height: 26px; margin-top: 30px;}
.game_credits img:hover {opacity: .6;}

.facts {column-count: 2; gap: var(--margin); margin: 100px 0;}
.facts .block {margin: 0 0 var(--margin);}

.stories {column-count: 1; gap: var(--margin);}
.stories .block {margin: 0 0 var(--margin);}

.minigames {display: grid; grid-template-columns: 1fr 1fr; gap: var(--margin); margin-bottom: 30px;}
.minigames .block {display: grid; grid-template-rows: auto auto 1fr auto; margin: 0;}
.minigames .button {margin-top: 0;}

.centered {max-width: 32em; margin: 100px auto 50px;}
.centered h2 {text-transform: none; font-size: x-large;}



/************************************ DOWNLOADS ************************************************/
.downloads {margin: 100px 0;}
.downloads h2 {max-width: 700px; margin: 0 auto 50px; text-align: center; line-height: 1lh; line-height: normal;}
.downloads + h2 {text-align: center;}

.files {margin: 20px 0;}
.files li {list-style: none; margin-bottom: 4px;}
.files li a {display: flex; justify-content: space-between; break-inside: avoid; padding: 10px 20px; border-radius: 30px; text-decoration: none; border: 3px solid #0001;}
.files li a:hover {color: currentColor; border-color: currentColor;}
.files li a span {font-family: monospace; font-size: larger;}
.files li a:hover span {color: currentColor;}

.buttons {display: flex; flex-direction: column; justify-content: center; align-items: start; gap: 10px; margin: 50px auto 20px;}
.buttons a {display: grid; grid-template-columns: auto 1fr; align-items: centeR; text-wrap: balance; gap: 15px; padding: 20px 30px 20px 20px; border-radius: var(--radius); text-decoration: none; color: currentColor; background: white;}
.buttons a:hover {color: white; background: var(--darkcolor);}
.buttons a:hover img {filter: invert(1);}
.buttons a strong {font-size: 1.25rem; font-weight: 700;}
.buttons a span {font-weight: 450;}

.versions {display: block; width: max-content; margin: 40px auto 0; font-size: 1rem; text-align: center; text-decoration: none !important; opacity: .33; transition: .15s ease-out; cursor: pointer; background: none;}
.versions:hover {opacity: 1;}
.versions + ul {max-height: 0; margin-top: 20px; overflow: hidden; transition: max-height .3s ease-out;}
.versions.opened {opacity: 1;}
.versions.opened + ul {max-height: 999px; transition: max-height .3s ease-in;}

.logos {display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; margin: 20px 0 0;}
.logos a {display: block; border-radius: 8px; background: white;}
.logos a:not([href]) {cursor: default; pointer-events: none;}
.logos a img {display: block; width: 100%; height: auto; margin: 0; object-fit: contain; transition: 0s;}
.logos a:hover {background: var(--darkcolor);}
.logos a:hover img {filter: contrast(0) brightness(4);}



/************************************ GAMES ************************************************/
.games {display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--margin); text-align: center;}
.games li {display: block; border: var(--border); border-radius: var(--radius); color: var(--lightcolor); background: var(--darkcolor); transition: transform .15s ease-out; position: relative; overflow: hidden;}
.games li:hover {border-color: var(--lightcolor); background: var(--lightcolor); transform: scale(1.1); position: relative; z-index: 1;}
.games li:hover div {opacity: 1; padding-bottom: 15px;}
.games img {display: block; width: 100%; height: auto; aspect-ratio: 210/297; background: var(--darkcolor); text-align: center; color: var(--linkcolor); font-size: smaller; line-height: normal;}
.games div {display: flex; flex-direction: column; justify-content: end; opacity: 0; position: absolute; left: 0; bottom: 0; z-index: 100; width: 100%; height: 100%; padding: 100px 25px 25px; margin: 0; font-size: .8rem; text-wrap: balance; background: linear-gradient(transparent 66%, #000E 100%); pointer-events: none; transition: .15s ease-out;}
.games h2 {margin: 0; font-size: .9rem; line-height: 1.1em; text-transform: none; text-wrap: balance;}

.games.games_small {grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));}
.games.games_small div {display: none;}



/************************************ VIDEOS AND IMAGES ************************************************/
video {display: block; width: 100%; height: auto; border: var(--border); border-radius: var(--radius); margin: 100px 0; background: var(--darkcolor);}
video:hover {border-color: var(--lightcolor);}
video[poster] {width: 100%; height: 100%; object-fit: cover; background: var(--darkcolor);}
video:fullscreen {padding: 0; border: 0; border-radius: 0; object-fit: contain;}

.fit {display: grid; align-items: center; width: 100%; height: auto; object-fit: contain; border: var(--border); border-radius: var(--radius); text-align: center; font-style: italic; color: var(--linkcolor); background: var(--darkcolor);}

.screenshots {position: relative; margin: 100px 0;}
.screenshots img {max-height: 900px; background: black;}
.screenshots img:not(:first-of-type) {display: none;}
.screenshots button {display: block; position: absolute; top: 50%; z-index: 8; width: 80px; height: 80px; padding: 5px; border-radius: 100px; background: none; cursor: pointer; transition: .15s ease-out;}
.screenshots button img {display: block; width: 60px; height: 60px; margin: auto; border-radius: 100px; padding: 10px; background: var(--lightcolor); transition: .2s ease-out;}
.screenshots button:hover img {width: 65px; height: 65px; padding: 15px; background-color: white;}

.prev {left: 0; transform: translate(-50%, -50%);}
.next {right: 0; transform: translate(50%, -50%);}

.zoom {cursor: zoom-in; transition: .15s ease-out;}
.zoom:hover {border-color: var(--lightcolor);}

.lightbox {display: flex; justify-content: center; align-items: center; position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; z-index: 999; background: #0008; backdrop-filter: blur(5px); opacity: 0; transition: opacity .15s ease-out; pointer-events: none; cursor: zoom-out;}
.lightbox.opened {pointer-events: inherit; opacity: 1; transition: 0;}
.lightbox img {width: calc(100% - var(--margin) - var(--margin)); border: var(--border); border-radius: var(--radius); object-fit: contain; object-position: center center; transform: scale(.8); transition: transform .15s ease-out;}
.lightbox.opened img {transform: scale(1); border-color: var(--lightcolor); background: var(--lightcolor);}



/************************************ POPUP ************************************************/
.popup {display: none; text-align: center; position: fixed; right: 100px; top: 50%; color: var(--lightcolor); transform: translateY(-50%); z-index: 9999;}
.popup:hover {transform: translateY(-50%) scale(1.1); color: white;}
.popup a {display: grid; align-items: center; width: 220px; height: 220px; position: relative; padding: 30px; z-index: 10; font-family: var(--displayfont); font-weight: 900; font-size: 1.4rem; line-height: .85em; color: currentColor; text-transform: uppercase;}
.popup:hover a {color: white;}
.popup svg {position: absolute; top: 0; left: 0; width: 100%; height: 100%; stroke: currentColor; animation: popup 30s infinite forwards linear; pointer-events: none;}

@keyframes popup {to {transform: rotate(360deg);}}



/************************************ FOOTER ************************************************/
footer {max-width: max-content; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 100px auto 20px;}
footer a {color: var(--lightcolor); color: currentColor; padding: 6px 20px; border: var(--border); border-radius: 30px; color: var(--linkcolor); background: black;}
footer a:hover {color: var(--lightcolor); border-color: var(--lightcolor);}



/************************************ FOCUS ************************************************/
*:focus-visible,
.games li:has(:focus-visible) {outline: 5px solid lime;}



/************************************ MEDIA QUERIES ************************************************/
@media (min-width: 900px) {
	:root {
		--margin: 10px;
	}
	body {padding: 0 50px 50px; margin: 50px; border: var(--border); overflow-x: visible; border-radius: calc(var(--radius) * 3);}
	header {margin-top: -3px;}
	header a {padding-top: 0;}
	main > .fit {margin: 100px 0;}
	main > .fit:first-of-type {margin-top: 0;}
	hgroup h1 {font-size: 3.5rem;}
	.regular {max-width: 640px; margin: var(--margin) auto;}
	.regular:nth-child(odd) {transform: translateX(50px);}
	.regular:nth-child(even) {transform: translateX(-50px);}
	.files {column-count: 2; gap: 4px; margin: 0;}
	.facts {max-width: 740px; margin: 100px auto;}
	.games {grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));}
	.game_data {grid-template-columns: 2fr 1fr;}
	.game_credits {position: sticky; top: var(--margin); margin-bottom: calc(var(--margin) * -1);}
	.game_credits dl {grid-template-columns: 1fr; gap: 0;  line-height: .8lh;}
	.game_credits dd {margin-bottom: 15px;}
	.game_credits img {display: block; height: 26px; margin-top: 1lh;}
	.cards {column-count: 3;}
	.downloads {margin-left: auto; margin-right: auto; max-width: 900px;}
	.lightbox img {width: auto; height: 90vh;}
	.stories {column-count: 3;}
	.popup {display: block;}
	.buttons {flex-direction: row;}
}
@media not (min-width: 900px) {
	html {font-size: medium; line-height: 1.4;}
	.block {padding: 20px;}
	.prev {left: 8px;}
	.next {right: 8px;}
	.minigames {font-size: smaller; line-height: 1.4em;}
	.minigames .block {padding: 15px; margin-top: 0;}
	.minigames .block h3 {font-size: 1.4em; margin-bottom: var(--margin);}
	.minigames .block img {margin: -15px 0 15px -15px; width: calc(100% + 30px);}
	.stories {column-count: 2; font-size: smaller; line-height: 1.4em;}
	.stories .block {padding: 15px; margin-top: 0;}
	.stories .block img {margin: -15px 0 15px -15px; width: calc(100% + 30px);}
}     