/* === Animations (kept as-is) === */
@keyframes Gradient { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes bwmovingOptimized { 0% { transform: translateX(0); } 100% { transform: translateX(-64px); } }
@keyframes bwmovingOptimized2 { 0% { transform: translateX(0) translateY(0); } 100% { transform: translateX(32px) translateY(32px); } }
@keyframes bwmovingOptimized3 { 0% { transform: translateX(0); } 100% { transform: translateX(32px); } }
@keyframes bwmovingOptimized4_BottomLayer { 0% { transform: translateX(0) translateY(0); } 100% { transform: translateX(-96px) translateY(-32px); } }
@keyframes bwmovingOptimized4_TopLayer { 0% { transform: translateX(0) translateY(0); } 100% { transform: translateX(-32px) translateY(-32px); } }
@keyframes B1stop { 0%, 100% { transform: translateX(100%); } }
@keyframes B1start { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes B2stop { 0%, 100% { transform: translateX(100%); } }
@keyframes B2start { 0% { transform: translateX(-50%); } 100% { transform: translateX(-20%); } }
@keyframes nineDown { 0%, 100% { transform: translateY(100%); } }
@keyframes nineDown1 { 0% { transform: translateY(-50%); } 100% { transform: translateY(0); } }
@keyframes stopY1 { 0%, 100% { transform: translateY(100%); } }
@keyframes moveY1 { 0% { transform: translateX(75vh); } 100% { transform: translateX(-75vh); } }
@keyframes stopY2 { 0%, 100% { transform: translateY(100%); } }
@keyframes moveY2 { 0% { rotate: 90deg; transform: translateX(-1000px); } 100% { rotate: 90deg; transform: translateX(-300px); } }
@keyframes stopX1 { 0%, 100% { transform: translateX(100%); } }
@keyframes moveX1 { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
@keyframes stopX2 { 0%, 100% { transform: translateX(100%); } }
@keyframes moveX2 { 0% { transform: translateX(0); } 100% { transform: translateX(-10%); } }

/* === Font === */
@font-face {
  font-family: "PressStart2P-Regular";
  src: url(/font/PressStart2P-Regular.woff2) format("woff2"),
       url(/font/PressStart2P-Regular.ttf) format("truetype");
  font-display: swap;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "PressStart2P-Regular", sans-serif;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  background-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* === Custom Cursor === */
.customCursor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
}
body, html, nav a, #myButton:hover, .customCursor {
  cursor: url(cur/pointer1.svg), auto;
}

/* === Front Panel (gradient background) === */
.frontM {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  overflow: hidden;
  background: linear-gradient(121deg, #3f5efb 30%, #ff5e7e 100%);
  background-size: 150% 100%;
  animation: Gradient 4s ease infinite;
  box-shadow: inset .5rem 0 0 #333, inset -.5rem 0 0 #333, inset 0 -.5rem 0 #333;
  display: flex;
  flex-direction: column;
}

/* === Nav === */
nav {
  flex-shrink: 0;
  background-color: #333;
  color: #eee;
  padding: 0.75rem 1rem;
  box-shadow: 1rem .3rem 0 #333;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
nav li { font-size: 1rem; }
nav a {
  display: inline;
  color: #eee;
  text-decoration: none;
  cursor: url(cur/pointer1.svg), auto;
}
nav a:hover { color: #f90; }

/* === Center Container (main content area) === */
.centerContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  overflow: hidden;
  position: relative;
}

/* === Text Styles === */
.greetings {
  color: #eee;
  letter-spacing: 1px;
  line-height: 1.8;
  text-align: center;
  text-shadow: 2px 2px 0 rgb(0 0 0);
  max-width: 42ch;
  width: 100%;
}

h1.greetings {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  margin-bottom: 0.75rem;
}

h2.greetings {
  font-size: clamp(0.7rem, 1.8vw, 1.1rem);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

#warning {
  color: #fffb00;
  font-size: clamp(0.65rem, 1.6vw, 1rem);
  margin-bottom: 1rem;
}

.highlight { background-color: #333; }

/* === Start Button === */
#myButton {
  font-family: "PressStart2P-Regular", sans-serif;
  --font-color: #323232;
  --bg-color: #eeeeee;
  --main-color: #323232;
  width: clamp(6rem, 12vw, 9rem);
  height: clamp(2rem, 4vw, 2.8rem);
  border: .2rem solid var(--main-color);
  background-color: var(--bg-color);
  border-radius: 1px;
  box-shadow: .2rem .2rem 0 var(--main-color);
  font-size: clamp(0.7rem, 1.5vw, 1.1rem);
  font-weight: 600;
  color: var(--font-color);
  flex-shrink: 0;
}
#myButton:hover {
  background: silver;
  text-decoration: none;
}
#myButton:active {
  box-shadow: 0 0 0 var(--main-color);
  transform: translate(.3rem, .3rem);
}

/* === Countdown === */
#startButtonCount {
  color: #eee;
  margin-top: 1rem;
  font-size: clamp(1.5rem, 4vw, 4rem);
  text-shadow: 4px 4px 0 rgb(0 0 0);
}

/* === Ad Slots === */
.ad-slot { overflow: hidden; }

.ad-slot-horizontal-bottom {
  min-height: 90px;
  width: 728px;
  max-width: 100%;
  height: 90px;
  margin-top: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  /* Placeholder */
  background: #000;
}

.ad-slot-vertical {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  min-height: 300px;
  max-height: 600px;
  display: block;
  /* Placeholder */
  background: #000;
}
.ad-slot-vertical-left { left: 1rem; }
.ad-slot-vertical-right { right: 1rem; }

@media screen and (max-width: 1023px) {
  .ad-slot-vertical { display: none !important; }
}
@media screen and (max-width: 767px) {
  .ad-slot-horizontal-bottom {
    width: 320px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }
  .ad-slot-horizontal-bottom .adsbygoogle {
    width: 320px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }
}

/* When side ads are visible (≥1024px), pad content to avoid overlap */
@media screen and (min-width: 1024px) {
  .centerContainer {
    padding-left: 190px;
    padding-right: 190px;
  }
}

/* Short viewports (landscape phones) — compress everything to fit */
@media screen and (max-height: 500px) {
  nav { padding: 0.4rem 0.75rem; }
  nav li { font-size: 0.75rem; }
  .centerContainer { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  h1.greetings { font-size: clamp(0.65rem, 2vw, 1rem); margin-bottom: 0.3rem; }
  h2.greetings { font-size: clamp(0.5rem, 1.4vw, 0.8rem); margin-bottom: 0.3rem; line-height: 1.5; }
  #warning { font-size: clamp(0.5rem, 1.3vw, 0.75rem); margin-bottom: 0.4rem; }
  #myButton { width: clamp(5rem, 10vw, 7rem); height: clamp(1.6rem, 3.5vw, 2.2rem); font-size: clamp(0.55rem, 1.2vw, 0.85rem); }
  .ad-slot-horizontal-bottom {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin-top: 0.5rem;
  }
  .ad-slot-horizontal-bottom .adsbygoogle {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }
}

.adsbygoogle { display: block; max-height: inherit; }

/* === Tooltip === */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: url(cur/pointer1.svg), auto;
}
.link { color: #f90; cursor: url(cur/pointer1.svg), auto; }
.tooltip .tooltiptext {
  display: none;
  color: #eee;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #323232;
  border: 3px solid #ccc;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.4);
  z-index: 999;
  text-align: left;
  box-sizing: border-box;
  width: 85%;
  max-width: 800px;
  padding: 2rem;
  font-size: clamp(0.6rem, 1.4vw, 1rem);
  line-height: 1.5;
  cursor: url(cur/pointer1.svg), auto;
}
.close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  color: #f90;
  font-size: 1.5rem;
  cursor: url(cur/pointer1.svg), auto;
}

/* === iOS Prompt === */
.ios-prompt {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  padding: 0.8rem;
  padding-bottom: 3rem;
  background-color: #eeeb;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: inset 0.3rem 0.3rem 0 #333, inset -0.3rem 0 0 #333, inset 0 -0.3rem 0 #333;
  box-sizing: border-box;
  z-index: 99999;
  text-align: center;
}
#promptButton {
  font-family: "PressStart2P-Regular", sans-serif;
  --font-color: #323232;
  --bg-color: #eeeeee;
  --main-color: #323232;
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  border-radius: 1px;
  box-shadow: 2px 2px 0 var(--main-color);
  font-size: clamp(0.65rem, 1.8vw, 0.9rem);
  font-weight: 400;
  color: var(--font-color);
  position: absolute;
  right: 1.2rem;
  bottom: 0.6rem;
  cursor: url(cur/pointer1.svg), auto;
}
#promptButton:hover {
  background: silver;
  text-decoration: none;
}
#promptButton:active {
  box-shadow: 0 0 0 var(--main-color);
  transform: translate(2px, 2px);
}
#pPrompt {
  font-family: "PressStart2P-Regular", sans-serif;
  font-size: clamp(0.55rem, 2.2vw, 0.8rem);
  line-height: 1.6;
  margin: 0.25rem auto 0.5rem;
  max-width: 95%;
  color: #323232;
}
#pngPrompt {
  display: block;
  margin: 0.4rem auto;
  height: clamp(1.8rem, 6vw, 2.5rem);
  width: auto;
}

/* === Animation Container (burn-in effects layer) === */
.container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

#switcher {
  width: 100vw;
  height: 100vh;
  position: relative;
  z-index: 2;
}

#blackwhite, #blackwhite2, #blackwhite3, #blackwhite4 {
  width: 100%;
  height: 100%;
  display: none;
  position: relative;
  overflow: hidden;
}

#blackwhite::before, #blackwhite2::before {
  content: "";
  position: absolute;
  background: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000 100%),
              linear-gradient(45deg, #000 25%, #fff 25%, #fff 75%, #000 75%, #000 100%);
  will-change: transform;
}

#blackwhite::before {
  top: 0; left: 0;
  width: calc(100% + 64px);
  height: 100%;
  background-size: 64px 64px;
  background-position: 0 0, 32px 32px;
  animation: bwmovingOptimized .1s linear infinite;
}

#blackwhite2::before {
  left: -32px; top: -32px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  background-size: 32px 4px;
  background-position: 0 0, 16px 16px;
  background-repeat: repeat;
  animation: bwmovingOptimized2 .15s linear infinite;
}

#blackwhite3::before, #blackwhite4::after, #blackwhite4::before {
  content: "";
  position: absolute;
  top: 0;
  background-repeat: repeat;
  will-change: transform;
}

#blackwhite3::before {
  left: -32px;
  width: calc(100% + 32px);
  height: 100%;
  background: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000 100%),
              linear-gradient(45deg, #000 25%, #fff 25%, #fff 75%, #000 75%, #000 100%);
  background-size: 32px 16px;
  background-position: 0 0, 16px 16px;
  animation: bwmovingOptimized3 .1s linear infinite;
}

#blackwhite4::before, #blackwhite4::after {
  left: 0;
  background-size: 64px 32px;
  width: calc(100% + 96px);
  height: calc(100% + 32px);
  background-image: linear-gradient(45deg, #000 25%, #fff 25%, #fff 75%, #000 75%, #000 100%);
  background-position: -32px 32px;
  animation: bwmovingOptimized4_BottomLayer .2s linear infinite;
}

#blackwhite4::after {
  width: calc(100% + 32px);
  background-image: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000 100%);
  background-position: 0 0;
  animation: bwmovingOptimized4_TopLayer .2s linear infinite;
}

#noiseA, #noiseA2, #noiseA3, #noiseA4, #noiseB, #noiseC, #noiseC2, #noiseD, #noiseD2 {
  height: 100%;
  width: 100%;
  display: none;
  z-index: 2;
}

#blocks, #blocks2 {
  margin: 0; padding: 0;
  height: 100%;
  width: 900%;
  position: relative;
  z-index: 3;
  background-size: 300px 300px;
}

#blocks {
  background: repeating-linear-gradient(to right, red 0, red 100px, #0f0 100px, #0f0 200px, #00f 200px, #00f 300px);
  animation: B1stop 9s linear infinite;
}

#blocks2 {
  background: repeating-linear-gradient(to right, red 0, red 10px, #0f0 10px, #0f0 20px, #00f 20px, #00f 30px);
  animation: B2stop 4.5s linear infinite;
}

#nineBlocks {
  margin: 0;
  width: 100%;
  height: 900vw;
  position: absolute;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges" width="60" height="30"><rect width="20" height="10" fill="red"/><rect y="10" width="20" height="10" fill="rgb(0, 255, 0)"/><rect y="20" width="20" height="10" fill="blue"/><rect x="20" width="20" height="10" fill="blue"/><rect x="20" y="10" width="20" height="10" fill="red"/><rect x="20" y="20" width="20" height="10" fill="rgb(0, 255, 0)"/><rect x="40" width="20" height="10" fill="rgb(0, 255, 0)"/><rect x="40" y="10" width="20" height="10" fill="blue"/><rect x="40" y="20" width="20" height="10" fill="red"/></svg>');
  background-size: auto auto;
  background-repeat: repeat;
  animation: nineDown 9s linear infinite;
  z-index: 2;
}

#stripY1 {
  margin: 0;
  width: 1500%;
  height: 600%;
  position: relative;
  left: -400%;
  animation: stopY1 4.5s linear infinite;
}

#stripX1, #stripX2, #stripY2 { height: 300%; transform: rotate(90deg); }
#stripY2 { width: 500%; position: relative; left: -200%; animation: stopY2 3s linear infinite; }
#stripX1, #stripX2 { width: 300%; animation: stopX1 1s linear infinite; }
#stripX2 { height: 200%; animation: stopX2 1s linear infinite; }

/* === Utility === */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}