/* Shared component styles */

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

.buttons a {
  display: block;
  min-width: 200px;
  max-width: 100%;
  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 {
  display: block;
  max-width: 100%;
  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;
}

.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;
}

.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;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.page-header h1 {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  margin: 0;
}

.page-header[data-header-nowrap="true"] h1 {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.page-header .back-button {
  width: fit-content;
}

/* 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.75rem;
  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;
}

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

/* Responsive Components */
@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;
  }

  .page-header h1 {
    font-size: clamp(1.3rem, 5.6vw, 2rem);
  }
}

@media (max-width: 600px) {
  .page-header h1 {
    font-size: clamp(1.1rem, 5vw, 1.7rem);
  }
}

@media (max-width: 420px) {
  .page-header h1 {
    font-size: clamp(0.9rem, 4.2vw, 1.25rem);
  }

  .footer-link {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

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