/* fatking styles --- */
:root {
  --page-width: 1000px;
  --color-base: #fff;
  --color-black: #1d1d1d;
  --color-skeleton: #f0f0f0;
  --color-bold: #635382;
  --color-turq: #25CADA;
  --color-dark: #2a9ba1;
  --color-mid: #36c4cd;
  --color-turq-light: #51D5E1;
  --color-triadic-1: #25CADA;
  --color-triadic-2: #DA25CA;
  --color-triadic-3: #CADA25;
  --color-green: chartreuse;
  --color-heading: #d1D5E1;
  --gz: 25%;
  --gca: #51D5E1;
  --gcb: #25CADA;
  --gs: 20px;

  /* sleigh bells dimensions */
  --sw: 374px;
  --sh: 561px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-base);
  color: var(--color-black);
  height: 100%;
  font-size: 16px;
  font-family:
    HelveticaNeue-Light, "Helvetica Neue Light", "Helvetica Neue", Helvetica,
    Arial, "Lucida Grande", sans-serif;
  font-weight: 300;
}

*,
*::after,
*::before {
  box-sizing: border-box;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  padding: 0;
  font-weight: 300;
  color: var(--color-heading);
}

html,
body {
  margin: 0;
}

canvas {
  position: absolute;
  top: 0;
  image-rendering: pixelated;
}

/*
a {
  text-decoration: none;
  color: var(--color-dark);
}

a:link, a:visited, a:hover, a:active {
  color: var(--color-dark);
}
*/

main {
  width: 100%;
}

.ftk-ui {
  transition: opacity 500ms ease-in-out;
}

.ftk-ui--hide {
  opacity: 0;
}

.header {
  position: relative;
  top: 0;
  padding: 2rem;
  letter-spacing: 0.1rem;
  border-bottom: 1px dotted var(--color-mid);
  max-width: var(--page-width);
  margin: 0 auto;
}

.nav {
	margin: 0 auto;
	padding: 0;
}

.nav__list {
	margin: 0;
	padding: 0;
}

.nav__list-item {
	position: relative;
	display: inline-block;
	list-style: none;
	letter-spacing: 0.02em;
	margin-right: 1.75rem;
	padding: 0.5rem 0.5rem 0.5rem 0;
}

.nav__link {
	text-decoration: none;
	transition: color 0.2s ease;
	color: var(--color-dark);
}

.nav__list-item:hover,
.nav__list-item:hover .nav__link {
	color: var(--color-black);
}

.nav__list-item ~ .nav__list-item::before {
	position: absolute;
	left: -1.75rem;
	top: 6px;
	transition: color ease 0.2s, left ease 0.2s;
	content:'\27F6';
}


.header--image {
  width: 135.5px;
  height: 53.5px;
}

.footer {
  border-top: 1px dotted var(--color-mid);
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
  text-align: center;
  background-color: rgb(255 255 255 / 100%);
}

.footer__caption {
  font-size: 13px;
  padding: 1rem;
  color: var(--color-dark);
}

.footer__image img {
  width: 135.5px;
  height: 53.5px;
}

.main--content {
  max-width: var(--page-width);
  width: 100%;
  min-height: 50vh;
  margin: 0 auto;
}

.main--content.main--game {
	max-width: none;
}

.title {
  font-size: 3rem;
  text-align: center;
}

/* index page --- */

.gamelist {
  margin: 0 auto;
  padding: 2rem 0;
  display: flex;
  gap: 2rem;
  justify-content: center;
  max-width: var(--page-width);
}

@media (max-width: 768px) {
	.gamelist {
		padding: 2rem 1rem;
		flex-direction: column;
		align-items: center;
	}
}

.gamelist__item {
  margin: 0;
  width: 100%;
  list-style: none;
}

.gamelist__figure {
	position: relative;
  margin: 0;
}

.gamelist__image-container {
  position: relative;
  display: block;
  background-color: var(--color-skeleton);
  border-radius: 6px;
  overflow: hidden;
}

.gamelist__image-container::before {
  content: "";
  padding-bottom: 100%;
  display: block;
}

.gamelist__image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 12%);
  opacity: 0;
  transition: opacity 0.3s linear;
}

.gamelist__caption {
	position: absolute;
  bottom: 0;
  padding: 1rem;
  font-size: 1rem;
  color: white;
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s linear;
}

.gamelist__caption::after {
	content:'\27F6';
	position: absolute;
	right: 1rem;
	color: blue;
	opacity: 0;
	transform: translateX(-1rem);
  transition: opacity 0.5s linear 0.4s, transform 0.7s ease 0.2s;
}

.gamelist__figure:hover .gamelist__caption {
	opacity: 1;
}

.gamelist__figure:hover .gamelist__caption::after {
	opacity: 1;
	right: 1rem;
	transform: translateX(0);
}

.gamelist__figure:hover .gamelist__image-container::after {
  opacity: 1;
}

.gamelist__figure:hover .gamelist__caption
{
  opacity: 1;
  transform: translateY(0);
}

.gamelist__image {
  position: absolute;
  top: 0;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* hiscores page --- */

.hiscores__more {
	padding: 2rem 0;
	width: 100%;
	text-align: center;
}
.hiscores__content {
  position: relative;
  min-height: 50vh;
  max-width: var(--page-width);
  margin: 0 auto;
}

.hiscores__header {
  text-align: center;
}

.hiscores__header h3 {
	padding: 2rem;
	font-weight: 300;
	letter-spacing: 0.02em;
}

.hiscores__nav {
	display: flex;
	justify-content: center;
}

.hiscores__item {
	display: inline-block;
	padding: 0 1rem;
}

.hiscores__link {
	text-decoration: underline;
}

.hiscores__link--active {
	font-style: italic;
}

.hiscores__list {
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.hiscores__listitem {
  padding: 0 2rem;
}

.hiscores__listitem-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--color-mid);
}

.hiscores__listitem:nth-child(even) {
	color: var(--color-mid);
}

.hiscores__listitem:nth-child(odd) {
  background-color: transparent;
}

.hiscores__listitem-col:nth-child(1) {
  margin-right: auto;
}

.hiscores__listitem-col:nth-child(3) {
  margin-left: auto;
}

/* sleighbells_start --- */


.main--sleighbells {
	position: relative;
	margin: 1rem 0;
}

@keyframes bg-fade {
	0% {
		background-color: #fff;
	}
	50% {
		background-color: #f00;
	}
	100% {
		background-color: #fff;
	}
}

/* fatking button */

.ftk-button {
	position: relative;
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
}

.ftk-button:hover {
	filter: brightness(1.25);
}

.ftk-button canvas {
	position: absolute;
	top: 0;
	left: 0;
}

/* end fatking button */

.sleighbells--container {
	height: 100%;
	background-image: linear-gradient(90deg, #6deef6 50%, #37c5cd 50%);
	background-size: 50px 50px;
}

.pointer {
	pointer-events: auto;
}

.nopointer {
	pointer-events: none;
}

.title-img {
	width: 261px;
	height: 96px;
}
.overlay {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 128px;
	right: 0;
	width: var(--sw);
	margin: 0 auto;
	text-align: center;
	pointer-events: none;
}
.overlay.overlay--show {
	pointer-events: auto;
}
.overlay__screen {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	opacity: 0;
	transition: opacity 0.2s ease-in-out;
	padding-top: 128px;
	pointer-events: none;
}
.overlay__screen.overlay__screen--show {
	opacity: 1;
	pointer-events: auto;
}
.ui-typography {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 800;
	font-style: italic;
	text-transform: uppercase;
	text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
	letter-spacing: -0.03em;
}
.ui--h2 {
	position: relative;
	padding-bottom:24px;
	font-size: 24px;
	color: #d251ca;
}
.ui--h2 canvas {
	left: 0;
}
.ui--bonus,
.ui--h3 {
	font-size: 32px;
	color: #1e80e3;
}
.ui--bonus {
	color: #ffff00;
	text-shadow: 2px 2px 0 rgba(0, 0, 0, 1);
}
.label {
	text-align: right;
	padding-right: 4px;
	width: 80px;
	font-size: 14px;
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 800;
	font-style: italic;
	text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
	text-transform: uppercase;
	color: #1e80e3;
}
.text-input {
	text-align: left;
	width: 160px;
	padding: 8px 16px;
	border-radius: 0;
	border: none;
	box-shadow: 2px 2px 0 black;
	font-family: monospace;
	font-weight: 400;
	background-color: white;
}
.text-input.text-score {
	opacity: 0.6;
	font-weight: 800;
}
.buttons {
	margin-top: 8px;
	margin-bottom: 8px;
}
.buttons.buttons--base {
	margin-top: 300px;
}
.buttons .buttons--btn {
	padding: 8px 16px;
	border-radius: 4px;
	border: 2px solid #419efc;
	background-color: #1e80e3;
	color: white;
	font-size: 16px;
	cursor: pointer;
}

.buttons .buttons--btn.buttons--btn-secondary {
	background-color: rgba(137, 137, 140, 1);
}

.buttons .buttons--btn:hover {
	background-color: #419efc;
	border-color: #1e80e3;
}

.buttons .buttons--btn.busy {
	opacity: 0.5;
	pointer-events: none;
	animation: bg-fade 500ms infinite ease-in-out;
}

.button {
	background-color: magenta;
	color: white;
	padding: 8px 16px;
	font-size: 12px;
	border-radius: 4px;
	border-style: none;
	cursor: pointer;
	outline: none;
}

.hidden {
	display: none;
}

.centred {
	display: flex;
	justify-content: center;
	align-items: center;
}

.game {
	position: relative;
	margin: 0 auto;
	width: var(--sw);
	height: var(--sh);
}

.interstitial {
	background-color: rgba(255, 255, 255, 0.25);
}

.score {
	padding: 20px;
	text-align: center;
}

.debug {
	position: fixed;
	white-space: pre;
	top: 0;
	left: 0;
	display: block;
	opacity: 0;
	margin: 0 auto;
	text-align: left;
	width: 256px;
	height: 50px;
	background: black;
	color: chartreuse;
	font-size: 11px;
	font-family: monospace;
}

/* sleighbells_end */

/* snake_start */
.wrapper {
  position: relative;
  margin: 10px auto;
  padding: 0;
  text-align: center;
  background-color: #fff;
  font-family: Joystix, monospace;
  -webkit-font-smoothing: antialiased;
  color: purple;
  width: 320px;
}

.snake-canvas {
  top: 20px;
  left: 0;
  background-color: #fefefe;
  margin: 0 auto;
  border: 2px solid lightblue;
}

.ui {
  text-align: center;
  font-size: 14px;
  width: 320px;
  margin: 0 auto;
}

.score-container {
  float: left;
  color: #03f;
}

.score-container span {
  color: #faf;
}

.hiscore-container {
  color: red;
  float: right;
}

.hiscore-container span {
  color: #faf;
}

/* snake_end */

/* rhombus_start */

.main--rhombus .game {
  position: relative;
  margin: 0 auto;
  width: 640px;
  height: 640px;
  box-shadow: 0 0 0 4px lightblue;
}

#diamond {
  width: 0;
  height: 0;
  border: 16px solid transparent;
  border-bottom-color: #fbaf5c;
  position: absolute;
  left: 64px;
  top: -16px;
}

#diamond::after {
  content: "";
  position: absolute;
  left: -16px;
  top: 16px;
  width: 0;
  height: 0;
  border: 16px solid transparent;
  border-top-color: #fbaf5c;
}

#game-base-ui {
  position: absolute;
  top: 640px;
  width: 640px;
  text-align: center;
  font-size: 2.5em;
  color: #fbaf5c;
}

#square {
  left: 64px;
  position: absolute;
  width: 30px;
  height: 30px;
  background: #fbaf5c;
}

#game-ui {
  background: white;
  width: 640px;
  height: 60px;
  position: relative;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 2rem;
  line-height: 2em;
  color: #fbaf5c;
}

.top-box {
  text-align: left;
}

.top-box.right {
  color: purple;
  text-align: right;
}

.rhombus-message {
  top: 320px;
  text-align: center;
  width: 100%;
  font-size: 3em;
  font-weight: 900;
  text-transform: uppercase;
  color: orange;
  text-shadow: 2px 2px black;
  position: absolute;
  display: none;
}

/* fatking anchor base */
.fk-anchor {
  position: relative;
  display: inline;
  color: hotpink;
  text-decoration: none;
  text-align: center;
}

.fk-anchor::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: hotpink;
  opacity: 0.5;
  transition: opacity 300ms ease-out;
}

.fk-anchor:hover::after {
  opacity: 1;
}

/* Dialog animation */
@keyframes dialog-overlay-enter {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes dialog-content-enter {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

/* Form element for hiscore submission */
.fk-dialog--container {
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 5%);
  border: none;
  border-radius: 16px;
  display: flex;
  opacity: 0;
  justify-content: center;
  align-items: center;
  animation-name: dialog-overlay-enter;
  animation-duration: 600ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

.fk-dialog--content {
  color: #2d2d2d;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px 2px rgb(0 0 0 / 10%);
  position: relative;
  padding: 2rem 0;
  transform: scale(0);
  animation-name: dialog-content-enter;
  animation-duration: 400ms;
  animation-delay: 300ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
  pointer-events: all;
}

.play-again-form {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.play-again-form > * + * {
  margin-top: 16px;
}

.hi-form fieldset {
  padding-top: 1.5rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-width: 7px 0 0;
  border-color: hotpink;
}

.hi-layout {
  display: grid;
  grid-template-columns: 0.25fr 1fr;
  gap: 1rem;
}

.hi-label {
  font-weight: bold;
  place-self: center end;
}

.hi-input {
  margin-bottom: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: 2px solid #f5f5f5;
  background-color: #f0f0f0;
}

input[readonly].hi-input {
  background-color: #f2f2f2;
}

/* Fatking button base */
.fk-button {
  position: relative;
  padding: 0.5rem 2rem;
  width: 100%;
  font-size: 14px;
  font-weight: bold;
  font-style: italic;
  border: none;
  border-radius: 4px;
  color: white;
  background-color: hotpink;
  cursor: pointer;
}

.fk-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: hsl(0deg 0% 93%);
  opacity: 0;
  transition: opacity 300ms ease-in-out;
}

.hi-button {
  grid-column-start: 2;
  position: relative;
}

.fk-button[disabled]::after {
  opacity: 0.75;
}

.fk-button[disabled]:hover::after {
  opacity: 0.75;
}

.fk-button:hover::after {
  opacity: 0.5;
}

.canvas {
  position: absolute;
  top: 0;
  image-rendering: crisp-edges;
}

.fps-counter {
  position: absolute;
  top: 33px;
  left: 0;
  font-size: 8px;
  font-family: monospace;
  text-transform: uppercase;
  color: black;
}

/* cleaner */
main.main--cleaner {
	margin: 0;
	padding: 0;
	height: 100%;
	overscroll-behaviour: none;
	touch-action: none;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}

section.section--cleaner {
	padding: 1rem 0;
	margin: 0 auto;
	text-align: center;
	width: 100%;
	height: 70dvh;
	display: flex;
	align-items: center;
}

canvas#cleaner-canvas {
	position: relative;
	width: 100%;
	height: auto;
	image-rendering: pixelated;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.debug-console {
	white-space: pre;
	background: black;
	color: chartreuse;
	font-family: monospace;
	font-size: 10px;
	position: absolute;
	top: 0;
	right: 0;
	display: inline;
}

.debug-ui {
	position: fixed;
	top: 0;
	right: 0;
	width: 250px;
	border: 1px dotted chartreuse;
	background-color: rgba(0, 0, 0, 0.1);
	font-size: 10px;
}

.debug-ui label {
	display: block;
}

.hide {
	display: none;
}

.info {
	display: flex;
	gap: 1rem;
	max-width: var(--page-width);
	margin: 0 auto;
	padding: 1rem 0 0;
	border-top: 1px dotted var(--color-mid);
}

.info__column {
	padding: 0 2rem;
}

