/* This should really be split into files, but it will be grand for now ;) */

/* 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');
}

/* Global Styles */
body {
  margin: 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;
}

.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: 1000px;
  margin: 0 auto;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  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%
    ),
    url('../assets/panorama.png');
  background-repeat: no-repeat, repeat-x;
  background-size: cover, auto 100%;
  background-position: center center, 0 center;
  animation: pan-background 960s linear infinite;
  animation-play-state: var(--bg-animation, running);
  filter: blur(2px);
}

@keyframes pan-background {
  0% {
    background-position: center center, 0 center;
  }
  100% {
    background-position: center center, -40000px center;
  }
}

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

.subtitle {
  font-size: 1.1rem;
  color: #FFF176;
  text-shadow: 2px 2px #000;
  margin-bottom: 1rem;
}

/* IP Display */
.ip-container {
  display: inline-flex;
  align-items: center;
  background: #835C3B;
  border: 2px solid #000;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
}

.ip-text {
  color: white;
}

.ip-button {
  background: #7A7A7A;
  color: white;
  border: 2px solid #000;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: transform 0.1s ease-in-out;
}

.ip-button:hover {
  transform: scale(1.05);
}

/* Buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.buttons a {
  display: block;
  min-width: 200px;
  padding: 1rem 2rem;
  background: #bbb;
  color: black;
  border: 3px solid #333;
  box-shadow: 4px 4px 0 #111;
  text-decoration: none;
  font-weight: bold;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.buttons a:hover {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 #111;
}

.back-button {
  background: #bbb;
  color: black;
  border: 3px solid #333;
  box-shadow: 4px 4px 0 #111;
  text-decoration: none;
  font-weight: bold;
  padding: 1rem 2rem;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  margin: 1rem auto 2rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.back-button:hover {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 #111;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
  padding: 1rem 0;
}

.gallery img {
  max-width: 300px;
  border: 4px solid #000;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.gallery img:hover {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  flex-direction: column;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 70%;
  max-height: 70%;
  border: 4px solid #000;
  margin-bottom: 1rem;
}

.lightbox .close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: white;
  font-family: sans-serif;
  cursor: pointer;
}

.lightbox-controls {
  display: flex;
  gap: 1rem;
}

.lightbox button {
  background: #7A7A7A;
  color: white;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  border: 2px solid #000;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.lightbox button:hover {
  background: #999;
}

/* Misc */
.back {
  display: inline-block;
  margin-top: 2rem;
  padding: 1rem 2rem;
  background: #7A7A7A;
  color: white;
  text-decoration: none;
  border: 3px solid #000;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
}

.frame {
  width: 300px;
  height: 300px;
  background-image: url('../assets/frame.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.frame img {
  width: 70%;
  height: 70%;
  object-fit: cover;
}

.description {
  font-size: 0.95rem;
  color: #eee;
  margin: 1rem 0;
  max-width: 600px;
  text-shadow: 1px 1px #000;
  line-height: 1.5;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
}

/* Footer */
.site-footer,
.index-footer {
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  border-top: 2px solid #333;
  z-index: 1000;
}

.site-footer {
  position: relative;
  text-align: center;
  padding: 1rem 0;
}

.index-footer {
  padding: 0.5rem 0 1rem;
  font-size: 0.65rem;
  box-sizing: border-box;
}

.footer-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.footer-row {
  width: 100%;
  text-align: center;
}

.footer-link {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  white-space: nowrap;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.footer-center {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

.admin-link {
  order: -1;
}

.credit-link {
  order: 1;
}

/* Scroll Top Button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #7A7A7A;
  color: white;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  border: 3px solid #000;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 3px 3px 0 #111;
  font-size: 1rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-top:hover {
  transform: scale(1.05);
  background: #999;
}

.scroll-top.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-wrapper {
    flex-direction: column;
    height: auto;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
  }

  .footer-link,
  .footer-center {
    position: static;
    transform: none;
    text-align: center;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery img {
    max-width: 90%;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.7rem;
    line-height: 1.2;
  }

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

@media (max-width: 480px) {
  .footer-row {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
}

/* Utility */
.nowrap {
  white-space: nowrap;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mute/Controls */
.controls-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  z-index: 10000;
}

.control-button {
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  background: #7A7A7A;
  color: white;
  border: 2px solid #000;
  font-family: 'Press Start 2P', 'Minecraftia', monospace;
  cursor: pointer;
  box-shadow: 2px 2px 0 #111;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.control-button:hover {
  background: #999;
}

/* Global link styles for dark content areas (excluding footer) */
.container a,
.container a:visited,
.wiki-section a,
.wiki-section a:visited {
  color: #FFD700;
  text-decoration: none;
}

.container a:hover,
.container a:focus,
.wiki-section a:hover,
.wiki-section a:focus {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Reapply black link color override for buttons (after animation fix) */
.buttons a,
.buttons a:visited,
.back-button,
.back-button:visited {
  color: black !important;
  text-decoration: none;
}

.buttons a:hover,
.back-button:hover {
  color: black !important;
  text-decoration: underline;
}
