/* Shared layout styles */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

@font-face {
  font-family: 'Minecraftia';
  src: url('../assets/Minecraftia.ttf') format('truetype');
}

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

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* Global Layout */
html {
  margin: 0;
  padding: 0;
  background: #000;
}

body {
  --bg-animation: running;
  --bg-animation-delay: 0s;
  --bg-animation-duration: 960s;
  --bg-animation-duration-ms: 960000;
  margin: 0;
  padding: 0;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 0;
  font-size: 12px;
  line-height: 1.4;
}

@media (min-width: 1280px) {
  body {
    font-size: 13px;
  }
}

@media (min-width: 1600px) {
  body {
    font-size: 14px;
  }
}

@media (min-width: 2200px) {
  body {
    font-size: 16px;
  }
}

.container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  box-sizing: border-box;
  text-align: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.panorama-bg {
  position: fixed;
  top: -24px;
  left: -24px;
  right: -24px;
  bottom: -24px;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.panorama-bg-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  width: max-content;
  animation: pan-track var(--bg-animation-duration, 960s) linear infinite;
  animation-delay: var(--bg-animation-delay, 0s);
  animation-play-state: var(--bg-animation, running);
  will-change: transform;
  transform: translateZ(0);
}

.panorama-bg-tile {
  height: 100%;
  flex: 0 0 var(--bg-tile-width, 4096px);
  background-image: image-set(
    url('/assets/panorama.webp') type('image/webp'),
    url('/assets/panorama.png') type('image/png')
  );
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
}

body::after {
  content: "";
  position: fixed;
  top: -24px;
  left: -24px;
  right: -24px;
  bottom: -24px;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 0) 85%
  );
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

@keyframes pan-track {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(calc(var(--bg-tile-width, 4096px) * -1), 0, 0);
  }
}

/* Headings */
h1 {
  font-size: 2.5rem;
  color: #5e7c16;
  text-shadow: 2px 2px #000;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: center;
}

/* Responsive Layout */
@media (max-width: 1024px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1.25rem;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.7rem;
    line-height: 1.2;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0.75rem;
  }
}
