/* Global */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background-color: #2b2d31;
  font-family: "Segoe UI", sans-serif;
  color: #f2f3f5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #1e1f22;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}
#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #5865f2;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Main content */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

h1 {
  font-size: 40px;
  margin-top: 20px;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  color: #ffffff;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 30px;
  width: 100%;
  max-width: 1800px;
  justify-content: center;
}

/* Button Wrapper */
.button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}
.button-wrapper:hover {
  transform: translateY(-5px);
}

/* Button */
.button {
  position: relative;
  width: 100%;
  min-height: 260px;
  max-height: 360px;
  background-color: #313338;
  border: 2px solid #444;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  color: #f2f3f5;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-align: center;
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
   transform-style: preserve-3d;
  transform: perspective(1000px);
  will-change: transform;
}
.button:hover {
  background-color: #404249;
  border-color: #5865f2;
}


.button.reset-tilt {
  transition: transform 0.3s ease;
}
/* Preview image blur effect */
.preview-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.8); /* Light blur + slightly dim */
  transition: filter 0.4s ease;
  z-index: 0;
}

.button:hover .preview-img {
  filter: blur(8px) brightness(0.5); /* Strong blur + dimmer on hover */
}
/* Button label */
.button span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-weight: 900;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  font-size: 16px;
  line-height: 1.2;
}

/* Hover Text (URL) */
.hover-text {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #b9bbbe;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
  width: 90%;
  pointer-events: none;
  z-index: 1;
   text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}
.button:hover .hover-text {
  opacity: 1;
}

/* Favicon icon */
.icon {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  z-index: 1;
  opacity: 0.95;
  pointer-events: none;
}

/* Description under each button */
.description {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  color: #b9bbbe;
  max-width: 100%;
}

/* Footer */
footer {
  width: 100%;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #b9bbbe;
  border-top: 1px solid #3f4147;
  background-color: #2b2d31;
  box-sizing: border-box;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive for Mobile */
@media (max-width: 1400px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 28px;
    margin-top: 10px;
    margin-bottom: 16px;
  }

  .button {
    height: 100px;
    font-size: 13px;
  }

  .icon {
    width: 18px;
    height: 18px;
    top: 6px;
  }

  .button span {
    font-size: 13px;
    padding: 0 6px;
  }

  .hover-text {
    font-size: 11px;
  }

  .description {
    font-size: 11px;
    max-width: 100px;
  }
}
@media (max-width: 400px) {
  .grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.discord-btn {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background-color: #5865f2;
  color: white;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.button:hover .discord-btn {
  opacity: 1;
  pointer-events: auto;
}

.discord-btn:hover {
  transform: translateX(-50%) scale(1.05);
  background-color: #6e78f8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

a {
  color: #66ccff; /* Soft light blue */
  text-decoration: none;
}

a:hover {
  color: #99e0ff; /* Slightly brighter on hover */
  text-decoration: underline;
}

.generic-btn {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background-color: #3a3b3f; /* Dark grey */
  color: #f0f0f0; /* Light text */
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.button:hover .generic-btn {
  opacity: 1;
  pointer-events: auto;
}

.generic-btn:hover {
  transform: translateX(-50%) scale(1.05);
  background-color: #505155; /* Lighter grey on hover */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
