/* =========================================================
   Stylesheet: Sicae / Curved Dagger Website
   Version: 2.2 – Full Restore + Server Status
========================================================= */

:root {
  --panel-width: 340px;
  --panel-gap: 12px;
}

/* ========== Global Reset & Base ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: none;
  color: #fff;
}

/* Hide default audio controls */
audio { display: none !important; }

/* ========== Background Layers ========== */
.bg-image {
  position: fixed;
  inset: 0;
  background: url("img/minecraft.jpg") center/cover no-repeat;
  z-index: -3;
  filter: brightness(0.4);
}
.fog-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background: url("img/fog.png") repeat;
  animation: moveFog 70s linear infinite;
}
@keyframes moveFog {
  from { background-position: 0 0; }
  to { background-position: 1200px 0; }
}
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ========== Hero Section ========== */
.container {
  text-align: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 10px;
  flex: 1 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Fancy Glowing Title */
.above-link-text {
  font-size: 44px;
  letter-spacing: 2px;
  display: inline-block;
  padding: 15px 30px;
  border-radius: 12px;
  background: linear-gradient(45deg, #d9d9d9, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glowPulseSync 2s infinite alternate ease-in-out;
  transition: transform 0.3s cubic-bezier(.22,.61,.36,1), text-shadow 0.3s ease-in-out;
}
.above-link-text:hover {
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255,255,255,0.6),
               0 0 20px rgba(255,255,255,0.4),
               0 0 35px rgba(255,255,255,0.3);
}
@keyframes glowPulseSync {
  0% { text-shadow: 0 0 6px rgba(255,255,255,0.3), 0 0 10px rgba(255,255,255,0.2); }
  100% { text-shadow: 0 0 16px rgba(255,255,255,0.7), 0 0 32px rgba(255,255,255,0.4); }
}

/* Link Styles */
a, a:visited {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
a:hover { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.4); }

/* Items / Discord Icon */
.items {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}
.item { flex: 1 1 200px; max-width: 300px; }
.item img {
  width: 100%;
  max-width: 200px;
  display: block;
  margin: 0 auto;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
}
.book-hover:hover { transform: translateY(-8px) scale(1.03); }
.title { font-weight: 700; font-size: 17px; color: #eee; margin: 5px 0 0; }
.subtitle { font-size: 12px; color: #cfcfcf; margin: 0; }

/* IP Box (Join) */
.ip-box {
  display: inline-block;
  margin: 22px auto 10px;
  padding: 12px 24px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  font-size: 1em;
  color: #fff;
  border-radius: 12px;
  line-height: 28px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  transition: box-shadow 0.4s ease;
}
.ip-box:hover { box-shadow: 0 0 25px rgba(255,255,255,0.25); }
.ip-box span { cursor: pointer; }
.ip-box span:hover { text-decoration: underline; }

/* Prevent underline on server status hover */
#server-text span:hover {
  text-decoration: none !important;
  cursor: default;
}

/* ========== Server Status (Restored & Below IP) ========== */
#server-status-wrapper {
  text-align: center;
  margin-top: 14px; /* spacing below IP */
  animation: fadeInUp 0.9s ease-out both;
}
.server-text {
  font-size: 20px;
  letter-spacing: 1px;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}
.server-text .prefix { color: #e0e0e0; margin-right: 6px; }
.server-text .status { font-weight: 700; }
.server-text .status.online {
  color: #00ff7a;
  text-shadow: 0 0 6px rgba(0, 255, 120, 0.6),
               0 0 12px rgba(0, 255, 120, 0.3);
  animation: pulseOnline 2.5s infinite ease-in-out;
}
.server-text .status.offline {
  color: #ff4d4d;
  text-shadow: 0 0 6px rgba(255, 80, 80, 0.5),
               0 0 10px rgba(255, 50, 50, 0.3);
  animation: pulseOffline 3s infinite ease-in-out;
}
.server-text .status.checking {
  color: #bbbbbb;
  text-shadow: 0 0 8px rgba(255,255,255,0.15);
}
@keyframes pulseOnline {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 255, 120, 0.6), 0 0 14px rgba(0, 255, 120, 0.4); }
  50% { text-shadow: 0 0 18px rgba(0, 255, 150, 0.9), 0 0 30px rgba(0, 255, 120, 0.6); }
}
@keyframes pulseOffline {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 60, 60, 0.5), 0 0 12px rgba(255, 60, 60, 0.3); }
  50% { text-shadow: 0 0 18px rgba(255, 80, 80, 0.8), 0 0 30px rgba(255, 40, 40, 0.5); }
}

/* ========== Animations (generic) ========== */
.fadeInUp { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.9s forwards ease-out; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* ========== Scroll Sections ========== */
.scroll-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease-out, transform 1s ease-out;
  will-change: opacity, transform;
}
.scroll-section.visible { opacity: 1; transform: translateY(0); }
.scroll-section h2 {
  font-size: 32px;
  color: #ffffff;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.scroll-section p { color: #ddd; font-size: 16px; line-height: 1.6; }

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.feature-box {
  background: rgba(0,0,0,0.55);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-box:hover { transform: translateY(-6px); box-shadow: 0 0 20px rgba(255,255,255,0.15); }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.gallery-grid img {
  width: 100%;
  border-radius: 10px;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.4s ease;
}
.gallery-grid img:hover { opacity: 1; transform: scale(1.05); }

/* ========== Footer (bottom-right ember glow) ========== */
.site-footer {
  position: static; /* changed from fixed */
  bottom: 20px;
  right: 20px;
  text-align: right;
  padding: 10px 18px;
  font-size: 0.9em;
  color: #dcdcdc;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  z-index: 1000;
  animation: emberGlow 4s ease-in-out infinite alternate;
}
@keyframes emberGlow {
  0% { text-shadow: 0 0 5px rgba(255,200,150,0.3), 0 0 10px rgba(255,180,100,0.2); }
  100% { text-shadow: 0 0 20px rgba(255,210,150,0.7), 0 0 40px rgba(255,190,120,0.4); }
}

/* ========== Mute Button (clean, no glow) ========== */
.mute-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 1100;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.mute-btn:hover { transform: scale(1.05); color: #4aff7a; }

/* ========== Discord Toggle + Custom JSON Panel ========== */
.discord-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  z-index: 1100;
  transition: right 0.35s cubic-bezier(.22,.61,.36,1), background 0.25s ease;
}
.discord-toggle:hover { background: rgba(255,255,255,0.18); }

.discord-panel {
  position: fixed;
  top: 20px;
  right: 0;
  transform: translateX(100%);
  width: var(--panel-width);
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px 0 0 12px;
  padding: 15px;
  opacity: 0;
  backdrop-filter: blur(10px);
  z-index: 1200;
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1), opacity 0.25s ease-in-out;
  box-shadow: 0 0 25px rgba(0,0,0,0.7);
  overflow-y: auto;
  max-height: 80vh;
}
.discord-panel:not(.hidden) { transform: translateX(0); opacity: 1; }
body.panel-open .discord-toggle { right: calc(var(--panel-width) + var(--panel-gap) + 20px); }

/* Discord Members */
.discord-humans h3 {
  margin: 0 0 10px;
  font-size: 18px;
  text-align: center;
  color: #00b4ff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
}
.discord-humans ul { list-style: none; margin: 0; padding: 0; }
.discord-humans li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  transition: background 0.2s ease;
}
.discord-humans li:hover { background: rgba(255,255,255,0.12); }
.discord-humans img { width: 28px; height: 28px; border-radius: 50%; }
.discord-humans span { color: #fff; font-size: 14px; }
.discord-humans .error { color: #ff6b6b; text-align: center; font-size: 14px; margin-top: 10px; }

/* ========== Mobile Tweaks ========== */
@media (max-width: 768px) {
  .above-link-text { font-size: 34px; }
  .item img { max-width: 170px; }
}
@media (max-width: 600px) {
  .discord-toggle { top: 14px; right: 14px; padding: 8px 12px; }
  .discord-panel {
    top: 60px;
    right: 14px;
    width: calc(100% - 28px);
    transform: translateY(-20px);
    border-radius: 12px;
    opacity: 0;
  }
  .discord-panel:not(.hidden) { transform: translateY(0); opacity: 1; }
  body.panel-open .discord-toggle { right: 14px; }
  .above-link-text { font-size: 28px; }
}

/* ===== Featured Video Section ===== */
#video {
  margin-top: 40px;
}

.video-wrapper {
  position: relative;
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.video-wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}


/* ===== Image Modal (Desktop only) ===== */
.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.img-modal.show {
  display: flex;
  opacity: 1;
}

.img-modal img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(255,255,255,0.2);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.img-modal.show img {
  opacity: 1;
}

.img-modal span {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 36px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.img-modal span:hover { color: #ff8080; }

.img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.img-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}
.img-nav.prev { left: 30px; }
.img-nav.next { right: 30px; }

@media (max-width: 768px) {
  .img-nav { display: none; }
}
