/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Base ===== */
html, body {
  width: 100%;
  height: 100%;
  font-family: 'Orbitron', sans-serif;
  color: #ffffff;
  cursor: none;
  background: #050505;
  overflow-x: hidden;
}

/* Support for disabling cursor via settings */
body.cursor-off { cursor: auto !important; }
body.cursor-off .custom-cursor { display: none !important; }
body.cursor-off a, 
body.cursor-off button, 
body.cursor-off .nav-card,
body.cursor-off .app-card { cursor: auto !important; }

/* ===== Background Canvas Layer ===== */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ===== Top Bar ===== */
.top-bar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.controller-home img {
  height: 32px;
  filter: drop-shadow(0 0 8px #00ffff);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-link {
  padding: 8px 18px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.6);
  background-size: 300% 300%;
  transition: transform 0.5s ease, box-shadow 0.8s ease, background 1s ease, border-color 0.8s ease, letter-spacing 0.8s ease;
  overflow: hidden;
  cursor: none;
}

.top-link:hover {
  border-color: transparent;
  background: linear-gradient(90deg, #4d8cff, #8a4dff, #ff4db8, #4d8cff);
  background-size: 400% 100%;
  transform: translateY(-2px) scale(1.05);
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(77, 140, 255, 0.6),
              0 0 20px rgba(138, 77, 255, 0.5), 
              0 0 35px rgba(255, 77, 184, 0.4),
              inset 0 0 10px rgba(255, 255, 255, 0.2);
  animation: gradientTravel 4s linear infinite, shineSweep 6s ease-in-out infinite;
}

/* ===== Discord Button ===== */
.discord-btn {
  padding: 8px 18px;
  text-decoration: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.6);
  background-size: 300% 300%;
  transition: transform 0.5s ease, box-shadow 0.8s ease, background 1s ease, border-color 0.8s ease, letter-spacing 0.8s ease;
  cursor: none;
}

.discord-btn:hover {
  border-color: transparent;
  background: linear-gradient(90deg, #4d8cff, #8a4dff, #ff4db8, #4d8cff);
  background-size: 400% 100%;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 10px rgba(77, 140, 255, 0.6),
              0 0 20px rgba(138, 77, 255, 0.5), 
              0 0 35px rgba(255, 77, 184, 0.4),
              inset 0 0 10px rgba(255, 255, 255, 0.2);
  animation: gradientTravel 4s linear infinite, shineSweep 6s ease-in-out infinite;
}

/* ===== Home Layout ===== */
.home {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.site-title {
  font-size: 64px;
  letter-spacing: 4px;
  text-shadow: 0 0 20px #00ffff;
}

.site-subtitle {
  opacity: 0.75;
  margin-bottom: 40px;
}

/* ===== Navigation Cards ===== */
.nav-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  perspective: 1000px;
}

.nav-card {
  width: 240px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.6s ease, background 0.4s ease, 
              border-color 0.6s ease;
  background-size: 300% 300%;
  overflow: hidden;
  position: relative;
  transform-style: preserve-3d;
  cursor: none;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.1) 55%,
    transparent 70%
  );
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.nav-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.2) 100%
  );
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

.nav-card * {
  position: relative;
  z-index: 10;
  transition: transform 0.4s ease;
  transform: translateZ(20px);
}

.nav-card:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
  background: linear-gradient(90deg, #4d8cff, #8a4dff, #ff4db8, #4d8cff);
  background-size: 400% 100%;
  transform: translateY(-8px) translateZ(30px) scale(1.05);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7),
              0 0 25px rgba(77, 140, 255, 0.9),
              0 0 50px rgba(138, 77, 255, 0.7),
              0 0 80px rgba(255, 77, 184, 0.5),
              inset 0 0 25px rgba(255, 255, 255, 0.4),
              inset 0 3px 6px rgba(255, 255, 255, 0.6);
  animation: gradientTravel 4s linear infinite,
              outlinePulse 2.5s ease-in-out infinite alternate,
              shineSweep 6s ease-in-out infinite,
              diamondShine 3s ease-in-out infinite;
}

.nav-card:hover::before {
  opacity: 0.8;
  animation: diamondShineSweep 2s ease-in-out infinite;
}

.nav-card:hover * {
  transform: translateZ(50px) translateY(-5px);
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.9);
}

.title-gif {
  width: 180px;
  height: auto;
  margin-bottom: 12px;
  display: block;
  border: 2px solid rgba(0, 255, 255, 0.8);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.6);
}

.nav-card img {
  width: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px #00ffff);
}

/* ===== Footer ===== */
.footer {
  position: fixed;
  bottom: 10px;
  width: 100%;
  text-align: center;
  opacity: 0.5;
  font-size: 12px;
}

/* ===== Custom Neon Cursor ===== */
.custom-cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  border: 2px solid #00ffff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: 
    transform 0.08s ease-out,
    width 0.15s ease,
    height 0.15s ease,
    box-shadow 0.2s ease;
  z-index: 99999;
  box-shadow: 0 0 12px #00ffffaa;
}

/* ===== Magic Hover Keyframes ===== */
@keyframes gradientTravel {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes outlinePulse {
  0% {
    box-shadow: 0 0 10px rgba(77, 140, 255, 0.7),
                0 0 25px rgba(138, 77, 255, 0.4), 
                0 0 45px rgba(255, 77, 184, 0.3),
                0 0 0 3px rgba(77, 140, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 18px rgba(255, 77, 184, 0.8),
                0 0 40px rgba(77, 140, 255, 0.6), 
                0 0 65px rgba(138, 77, 255, 0.4),
                0 0 0 5px rgba(255, 77, 184, 0.15);
  }
}

@keyframes shineSweep {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}

@keyframes diamondShineSweep {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes diamondShine {
  0%, 100% {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(77, 140, 255, 0.8),
                0 0 40px rgba(138, 77, 255, 0.6),
                0 0 60px rgba(255, 77, 184, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.3),
                inset 0 2px 4px rgba(255, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(77, 140, 255, 1),
                0 0 50px rgba(138, 77, 255, 0.8),
                0 0 80px rgba(255, 77, 184, 0.6),
                inset 0 0 30px rgba(255, 255, 255, 0.5),
                inset 0 4px 8px rgba(255, 255, 255, 0.7);
  }
}

/* ===== ADDED SETTINGS PANEL UI ===== */
.settings-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100%;
  background: rgba(5, 5, 5, 0.98);
  backdrop-filter: blur(20px);
  border-left: 2px solid #00ffff;
  z-index: 100000;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.settings-panel.open { right: 0; }

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}

.settings-header h2 { font-size: 20px; color: #00ffff; text-shadow: 0 0 10px #00ffff; }

.close-settings-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: none;
}

.settings-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  color: #9ffcff;
  opacity: 0.6;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Settings Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: none;
  inset: 0;
  background-color: #333;
  transition: .4s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider { background-color: #00ffff; }
input:checked + .slider:before { transform: translateX(22px); }

.bg-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bg-opt {
  border: 2px solid transparent;
  border-radius: 12px;
  background: #111;
  padding: 8px;
  text-align: center;
  cursor: none;
  transition: 0.2s;
}

.bg-opt.active { border-color: #00ffff; box-shadow: 0 0 10px #00ffff; }
.bg-opt span { font-size: 11px; font-weight: bold; }

.cloak-input {
  width: 100%;
  background: #111;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 12px;
  color: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  font-family: 'Orbitron';
  font-size: 12px;
}

.cloak-launch-btn {
  width: 100%;
  padding: 12px;
  background: #00ffff;
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-family: 'Orbitron';
  cursor: none;
}