:root {
	--lightcolor: lightgray;
	--darkcolor: black;
	--linkcolor: dimgray;
	--border: 3px solid #333;
	--displayfont: 'clashdisplay', sans-serif;
	--regularfont: 'archivo', sans-serif;
	--radius: 15px;
	--margin: 10px;
}

/* FONTS */

@font-face {font-family: 'clashdisplay'; src: url("fonts/clashdisplay-semibold.woff2"); font-weight: bold; font-display: swap;}
@font-face {font-family: 'archivo'; src: url("fonts/archivo.woff2"); font-weight: normal; font-style: normal; font-display: swap;}
@font-face {font-family: 'archivo'; src: url("fonts/archivo-bold.woff2"); font-weight: bold; font-style: normal; font-display: swap;}

/* RESET */

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

/* BODY */

html {font-family: var(--regularfont); letter-spacing: .02em; line-height: 1.4rem; color: var(--lightcolor); background: var(--darkcolor); position: relative; scroll-behavior: smooth; overflow-x: hidden;}
body {min-height: calc(100vh - 100px); padding: 0 var(--margin) var(--margin); background: url("images/background.gif") no-repeat top center var(--darkcolor); background-size: cover; background-attachment: fixed; overflow-x: hidden;}
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;}
header a svg {display: block; width: 90px; height: 90px; padding: 15px; margin: auto; fill: var(--lightcolor); transition: .6s ease-out;}
header a:hover svg {transform: rotateY(-180deg);}

/* MENU */

.menu {display: none; font-size: small; text-transform: uppercase; text-align: center; font-weight: bold; color: var(--lightcolor); user-select: none; line-height: 50px;}
.menu div {display: flex; flex-direction: column; gap: 15px; position: fixed; width: 50px; overflow: visible; top: 50%; transform: translateY(-50%); display: flex; justify-content: center;}
.menu div.navigation {left: 0; transform-origin: top left;}
.menu div.navigation a {transform: rotate(180deg);}
.menu div.language {right: 0; top: 50%; transform-origin: top right;}

.menu a {display: block; white-space: nowrap; padding: 20px 0; margin: 0; letter-spacing: .5em; writing-mode: vertical-lr; color: var(--lightcolor);}
.menu a:hover:not(.current) {color: white;}
.menu a.current {color: var(--darkcolor); background: var(--lightcolor);}
.menu a.current:hover {background: white;}
.menu span {padding: 0;}

/* MOBILE MENU */

.mobile_menu {display: block; font-family: var(--displayfont); font-size: larger; color: var(--lightcolor);}

.mobile_menu .mobile_menu_button {position: absolute; top: var(--margin); right: var(--margin); z-index: 200; cursor: pointer; transition: 0s;}
.mobile_menu .mobile_menu_button svg {fill: none; stroke: currentColor; stroke-width: 3px;}
.mobile_menu .mobile_menu_button svg:first-child {display: block;}
.mobile_menu .mobile_menu_button svg:last-child {display: none;}
.mobile_menu .mobile_menu_button.opened svg:first-child {display: none;}
.mobile_menu .mobile_menu_button.opened svg:last-child {display: block;}

.mobile_menu_links {display: none; flex-direction: column; justify-content: center; gap: 8px; margin-bottom: 80px;}
.mobile_menu_links.opened {display: flex;}
.mobile_menu_links 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;}
.mobile_menu_links a:hover {color: white;}
.mobile_menu_links a.current {color: var(--darkcolor); background: var(--lightcolor);}
.mobile_menu_links a.current:hover {color: var(--darkcolor); background: white;}
.mobile_menu_links div {display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px;}
.mobile_menu_links div a {font-size: 1.25rem;}

/* MAIN */

main {max-width: 800px; margin: 0 auto;}
main.home {max-width: 1100px;}

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

h1 {font-family: var(--displayfont); font-size: xx-large; margin-bottom: 30px; line-height: 1em; text-transform: uppercase; text-wrap: balance;}
h2 {font-family: var(--displayfont); font-size: xx-large; margin-bottom: 30px; line-height: 1em; text-wrap: balance;}
h2.block {max-width: 18em; margin-bottom: 0;}
h3 {font-family: var(--displayfont); font-size: x-large; margin-bottom: 20px; line-height: 1em;}

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: 25px; 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 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 br {margin-bottom: 20px;}
.block > img:first-child {display: block; width: calc(100% + 50px); margin: -25px 0 25px -25px; height: auto; border: 0; border-radius: 0;}
.block .button {display: block; width: max-content; padding: 4px 10px; margin: 15px 0 0 auto; border-radius: 15px; color: var(--lightcolor); background: var(--darkcolor); text-transform: uppercase; text-decoration: none; font-size: smaller; font-weight: bold;}
.block .button:hover {color: white;}

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

.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 h2 {display: none;}
.game_credits dl {display: grid; grid-template-columns: auto 1fr; gap: 0 20px; font-size: .9rem; line-height: 1.2em;}
.game_credits dt {font-weight: bold;}
.game_credits dd br {margin: 0;}
.game_credits a {text-decoration: underline;}
.game_credits img {display: block; height: 26px; margin-top: 30px;}
.game_credits img:hover {opacity: .6;}

.features li {margin-left: 40px; list-style: none; position: relative;}
.features li:before {display: block; width: 20px; height: 15px; content: " "; border-bottom: 2px solid; position: absolute; left: -40px; top: -4px;}

.facts {column-count: 2; gap: var(--margin); margin: 80px 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;}
.centered br {display: none;}

.welcome {margin: 80px 0 0;}
.welcome .block:first-of-type {max-width: 20em;}
.welcome br {display: none;}

/* DOWNLOADS */

.downloads {margin: 80px 0;}
.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: 8px 16px; border-radius: 24px; line-height: 1.3rem; 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; color: #0003;}
.files li a:hover span {color: currentColor;}

.buttons {display: flex; gap: 10px; margin: 50px auto 20px;}
.buttons a {display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; text-wrap: balance; gap: 10px; padding: 15px 20px 15px 15px; border-radius: var(--radius); line-height: 1rem; text-decoration: none; color: currentColor; background: white;}
.buttons a:hover {color: white; background: var(--darkcolor);}
.buttons a svg {stroke-width: 3.5px; stroke: currentcolor; fill: none; stroke-linecap: round; stroke-linejoin: round; width: 40px; height: auto;}
.buttons a strong {font-family: var(--displayfont);}
.buttons a br {margin-bottom: 0;}
.buttons a span {font-size: smaller;}

.versions {display: block; width: max-content; margin: 40px auto 0; text-align: center; text-decoration: none !important; opacity: .33; transition: .15s ease-out; cursor: pointer;}
.versions:hover {opacity: 1;}
.versions + ul {max-height: 0; 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 div {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 div img {display: flex; justify-content: center; align-items: center; 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:hover {border-color: var(--lightcolor); background: var(--lightcolor); transform: scale(1.05);}
.games div h2 {display: grid; align-items: end; opacity: 0; position: absolute; left: 0; bottom: 0; z-index: 100; width: 100%; height: 100%; padding: 80px 50px 25px; margin: 0; font-size: .9rem; line-height: 1.1em; text-transform: none; text-wrap: balance; background: linear-gradient(transparent 70%, #000E 100%); pointer-events: none; transition: .15s ease-out;}
.games div:hover h2 {opacity: 1; padding-bottom: 15px;}

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

/* VIDEOS AND IMAGES */

video {display: block; width: 100%; height: auto; border: var(--border); border-radius: var(--radius); margin: 80px 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: 80px 0;}
.screenshots img {max-height: 640px; 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 svg {display: block; width: 50px; height: 50px; margin: auto; border-radius: 100px; padding: 10px; fill: none; stroke: var(--darkcolor); stroke-width: 3px; background: var(--lightcolor); transition: .2s ease-out;}
.screenshots button:hover svg {width: 60px; height: 60px; padding: 10px; 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: bold; 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: 80px auto 20px;}
footer a {color: var(--lightcolor); color: currentColor; padding: 6px 20px; border: var(--border); border-radius: 10px; color: dimgray; background: black;}
footer a:hover {color: var(--lightcolor); border-color: var(--lightcolor);}


/* MEDIA QUERIES */

@media (min-width: 900px) {
	:root {
		--margin: 20px;
	}
	body {padding: 0 50px 50px; margin: 50px; border: var(--border); overflow-x: visible;}
	header {margin-top: -3px;}
	header a svg {width: 110px; height: 100px; padding: 0 20px 20px;}
	hgroup h1 {font-size: 3.5rem;}
	main > .fit {margin: 80px 0;}
	main > .fit:first-of-type {margin-top: 0;}
	.menu {display: flex;}
	.mobile_menu {display: none;}
	.welcome {display: grid; grid-template-columns: 2fr 3fr; gap: var(--margin); margin: 80px;}
	.welcome .block:first-of-type {max-width: inherit;}
	.regular:nth-of-type(odd) {margin: 20px 80px 20px 200px;}
	.regular:nth-of-type(even) {margin: 20px 200px 20px 80px;}
	.files {column-count: 2; gap: 4px; margin: 20px;}
	.facts {margin: 80px;}
	.games {grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));}
	.games.games_small {grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));}
	.game_data {grid-template-columns: 2fr 1fr;}
	.game_credits dl {grid-template-columns: 1fr; gap: 0;}
	.game_credits dd {margin-bottom: 15px;}
	.game_credits img {display: block; height: 26px; margin-top: 10px;}
	.cards {column-count: 3;}
	.lightbox img {width: auto; height: 90vh;}
	.stories {column-count: 3;}
	.popup {display: block;}
	.buttons {justify-content: center;}
	.buttons a {flex-direction: row; text-align: left;}
	.buttons a strong {display: block; margin-bottom: 3px;font-size: 1.4rem;}
	.buttons a br {display: none;}
}
@media (max-width: 900px) {
	.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);}
}