body {
  margin: 0;
  padding: 21px;
  background-color: #0d0d1a;
  height: 100vh;
  box-sizing: border-box;
  cursor: url("../img/cursor.png"), auto;
}

h1 {
  font-family: "VT323", monospace;
  color: #68ff9e;
  font-size: 5rem;
  margin: 0;
  text-shadow: 3px 3px 0 #000, -3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000;
  line-height: 1;
}

h2,
a {
  font-family: "VT323", monospace;
  color: #f0c8c8;
  font-size: 2rem;
  margin: 0;
  text-decoration: none;
}

ul {
  list-style-type: none;
  line-height: 4rem;
  text-align: center;
  padding: 0;
  margin: 0;
}

#logo {
  position: relative;
  font-size: 5rem;
  font-family: "VT323", monospace;
  color: #68ff9e;
  text-shadow: 3px 3px 0 #000, -3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000;
  padding: 2rem 0 0 2rem;
  margin-top: -20px;
  z-index: 2;
}

#more-games-overlay-text {
  font-family: "VT323", monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: white;
  margin: 0;
  text-align: center;
  padding: 6rem;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

#info-icon {
  width: 3rem;
  height: 3rem;
  image-rendering: pixelated;
  cursor: help;
}

.key-block-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.disclaimer-link {
  all: unset;
  cursor: pointer;
  position: absolute;
  left: 2rem;
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  color: #f0c8c8;
  text-decoration: underline;
  text-shadow: 1px 1px #000;
}

.key-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-left: 1.5rem;
}

.key {
  font-family: "VT323", monospace;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d0d1a;
  height: 1.5rem;
  background: #f0c8c8;
  padding: 0.5rem;
  min-width: 1rem;
  text-align: center;
  user-select: none;
  border: 2px solid #000;
  text-shadow: 1px 1px #000;
  border-radius: 0.5rem;
}

.key-block p {
  font-family: "VT323", monospace;
  font-size: 1rem;
  color: #f0c8c8;
  margin: 0;
}

.key:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 2px #fff, 2px 2px 0 #000, -1px -1px 0 #f0c8c8;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

#games {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-height: calc(100vh - 320px);
  padding: 2.2rem 2rem 2rem 2rem;

  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

#games::-webkit-scrollbar {
  display: none;
}

a.game {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-family: "Press Start 2P", cursive;
  font-size: 1rem;
  color: #ff66cc;
  background: linear-gradient(to bottom, #6e1d93, #290142);
  border: 4px solid #ff33aa;
  border-radius: 1rem;
  padding: 1.5rem 2.5rem;
  box-shadow: inset 0 0 0 4px #000, 0 8px 0 #c02774, 0 12px 0 #000;
  transition: transform 0.2s ease;
  image-rendering: pixelated;
  cursor: url("../img/hover_cursor.png"), pointer;
}

a.game:active,
a.game.active {
  transform: translateY(4px);
  box-shadow: inset 0 0 0 4px #000, 0 4px 0 #c02774, 0 6px 0 #000;
  background: linear-gradient(to bottom, #5b1681, #1a0030);
  color: #ff66cc;
  border-color: #ff66cc;
}

a.game:hover {
  background-color: #7a24b2;
  box-shadow: inset 0 0 0 4px #000, 0 10px 0 #d6368c, 0 14px 0 #000;
  transform: scale(1.01);
}

@keyframes pulse {
  0% {
    transform: scale(1.05);
    box-shadow: 0 0 12px #68ff9e;
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 20px #f0c8c8;
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 12px #68ff9e;
  }
}

a.game.active {
  animation: pulse 1s infinite;
}

.glow-box {
  width: 100%;
  height: 100%;
  padding: 21px;
  background: linear-gradient(45deg, #ed1b51, #bf6bab);
  border-radius: 32px;
  box-sizing: border-box;
}

.content {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  background: none;
  overflow: hidden;
  border-radius: 1rem;
}

.content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../img/91657.jpg") center repeat-x;
  background-size: cover;
  opacity: 0.9;
  background-size: cover;
  z-index: -1;
}

.pixel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  position: relative;
  transform-origin: top left;
  overflow: hidden;
  background-image: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    );
  image-rendering: pixelated;
  z-index: 99;
  background-image: linear-gradient(rgba(0, 0, 0, 0.1) 50%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    );
  background-size: 100% 2px;
}

.inner-ring {
  position: absolute;
  top: 29px;
  left: 29px;
  right: 29px;
  bottom: 29px;
  border-radius: 24px;
  padding: 3px;
  background: linear-gradient(-121deg, #f7ec2f, #4c9dd6, #ea892e, #48af48);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-sizing: border-box;
  pointer-events: none;
}

#right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 0.25rem;
  padding: 2rem 2rem 2rem 0;
}

#preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#preview img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  border: 4px solid var(--border-color);
  box-sizing: border-box;
}

.preview-box {
  background: linear-gradient(
        var(--background-color, rgba(13, 13, 26, 1)),
        var(--background-color, rgba(13, 13, 26, 1))
      )
      padding-box,
    linear-gradient(180deg, var(--border-gradient-start), var(--border-gradient-end)) border-box;
  color: var(--text-color);
  border: 4px solid transparent;
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  padding: 1rem;
  border-radius: 1rem;
  position: relative;
}

#credits a {
  color: #51a6dc;
  text-decoration: underline;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 98;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  position: relative;
  width: 95%;
  height: 95%;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
}

#game-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#close-overlay {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #fff;
  border: none;
  font-size: 1.5rem;
  z-index: 1000;
  cursor: pointer;
}

.preview-box.warning {
  color: #b94a48;
  background-color: #f2dede;
  border: 1px solid #ebccd1;
  padding: 10px;
  margin-top: 10px;
  border-radius: 1rem;
}

#preview-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

#preview-media img,
#preview-media video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 1s ease;
  border-radius: 0.5rem;
  display: block;
  object-fit: cover;
}

#preview-image {
  z-index: 1;
  opacity: 1;
  transition: opacity 1s ease;
}

#preview-image.fade-out {
  opacity: 0;
}

#preview-video {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

#preview-video.fade-in {
  opacity: 1;
}

#disclaimer-text {
  position: absolute;
  top: 3rem;
  left: 2rem;
  right: 2rem;
  bottom: 2rem;
  overflow-y: auto;
  padding: 2rem;
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  color: #f0c8c8;
  z-index: 100;
  text-shadow: 1px 1px 0 #000;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4rem;
}

#disclaimer-text h2,
#more-games-overlay-text h2 {
  font-size: 3rem;
  color: #ff66cc;
  text-shadow: 1px 1px 0 #000, 0 0 6px #ff66cc;
  text-align: center;
}

#disclaimer-text p {
  line-height: 1.6;
  font-size: 2rem;
  color: #f0c8c8;
  margin: 0;
  text-align: center;
}

#disclaimer-text a {
  color: #ff66cc;
  text-decoration: underline;
  text-shadow: 1px 1px #000;
}

.overlay.disclaimer-mode #game-iframe {
  background: repeating-linear-gradient(45deg, #290142, #290142 10px, #1a002f 10px, #1a002f 20px),
    radial-gradient(circle at center, #000 0%, #120012 100%);
  background-blend-mode: screen, normal;
  animation: disclaimerFlash 6s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.3s ease;
  text-align: center;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #ff66cc, 0 0 0 6px #000;
}

.hidden {
  display: none !important;
}
