@font-face {
  font-family: 'VCR OSD Mono';
  src: url('../fonts/VCR_OSD_MONO_1.001.ttf') format('truetype');
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

body {
  isolation: isolate;
  background: #06000d;
  color: white;
  font-family: 'VCR OSD Mono', monospace;
  min-height: 100vh;
  min-width: 100vw;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#container {
  position: relative;
  z-index: 2;
  top: unset;
  left: unset;
  transform: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
  margin-top: 0.5vh;
}

#hangingGirl {
  max-width: 100%;
  height: auto;
  max-height: 40vh;
  margin-top: -50vh;
  animation: swing 3s ease-in-out infinite;
  transform-origin: top center; 
}

@keyframes swing {
  0%   { transform: rotate(-4deg); }
  50%  { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}

#text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 15px;
}

.blaze {
  position: relative;
  display: block;
  margin: -3px 0;
  font-size: 2.5vw;
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  transition: color 0.3s ease;
  cursor: pointer;
}

.blaze:hover,
.blaze:focus-visible {
  color: crimson;
}

#copy-feedback {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  white-space: nowrap;
  font-size: clamp(9px, 1.15vw, 16px);
  line-height: 1;
  color: white;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
  transition: opacity .15s ease, visibility .15s ease;
  pointer-events: none;
}

#copy-feedback.visible {
  opacity: 1;
  visibility: visible;
}

#copy-feedback img {
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  filter: grayscale(1) contrast(1.25) brightness(1.5);
}

#idle-notice {
  position: fixed;
  z-index: 12;
  left: 0;
  top: 0;
  color: #ff3030;
  font-size: clamp(12px, 1.5vw, 20px);
  text-shadow: 0 0 5px #a00000;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(14px, 14px);
  transition: opacity .15s ease, visibility .15s ease;
  pointer-events: none;
}

#idle-notice.visible {
  opacity: 1;
  visibility: visible;
}

#japan-easter-egg {
  position: fixed;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: .45em;
  padding: .2em .35em;
  border: 1px solid rgba(177, 108, 255, .55);
  background: rgba(0, 0, 0, .78);
  box-shadow: 0 0 10px rgba(154, 74, 255, .3);
  opacity: 0;
  visibility: hidden;
  transform: translate(12px, 12px);
  transition: opacity .18s ease, visibility .18s ease;
  pointer-events: none;
}

#japan-easter-egg.visible {
  opacity: 1;
  visibility: visible;
}

.japan-easter-text {
  display: block;
  width: auto;
  height: clamp(17px, 2.1vw, 30px);
  object-fit: contain;
}

.japan-flag {
  display: block;
  width: auto;
  height: clamp(20px, 2.5vw, 34px);
  object-fit: contain;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10px);
  }
}

#stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

#background img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: grayscale(100%) contrast(.4) brightness(.3);
}

.background-contrast,
.background-dither,
.background-grain,
.background-dither-final {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.background-contrast {
  z-index: 3;
  -webkit-backdrop-filter: contrast(6.5) brightness(5) saturate(.2) brightness(4);
  backdrop-filter: contrast(6.5) brightness(5) saturate(.2) brightness(4);
}

.background-dither {
  z-index: 2;
  opacity: .7;
  background-image: url('../images/bayer.png');
  background-size: .5em;
  background-attachment: fixed;
  mix-blend-mode: color-dodge;
  filter: contrast(.45);
  image-rendering: pixelated;
}

.background-grain {
  z-index: 3;
  opacity: .025;
  background: url('../images/grain.gif') 0 0 / auto auto;
  background-attachment: fixed;
  mix-blend-mode: overlay;
}

.background-dither-final {
  z-index: 5;
  background-image: url('../images/bayer.png');
  background-size: .5em;
  background-attachment: fixed;
  mix-blend-mode: color-dodge;
  filter: grayscale(1);
  image-rendering: pixelated;
}

@media (max-width: 600px) {
  #container {
    max-width: 95vw;
    padding: 0.5rem;
    margin-top: 0;
  }
  #hangingGirl {
    max-height: 14vh;
    margin-top: -3vh;
  }
  .blaze {
    font-size: 4vw;
  }
}
