:root {
  --bg-dark: #0a0a0f;
  --bg-darker: #05050a;
  --primary: #0066cc;
  --primary-light: #0088ff;
  --accent: #00ffff;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.7);
  --glass-bg: rgba(20,20,40,0.4);
  --glass-border: rgba(255,255,255,0.1);
  --success: #43e97b;
  --error: #ef4444;
}

.feature-disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(1);
}

.achievement-disabled {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.light-beam {
  position: fixed;
  top: -50%;
  left: -10%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0,255,255,0.03) 25%,
    rgba(0,204,255,0.08) 50%,
    rgba(0,255,255,0.03) 75%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  z-index: 0;
  animation: sweepLight 8s ease-in-out infinite;
  filter: blur(2px);
}

@keyframes sweepLight {
  0% { 
    left: -50%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  50% {
    left: 50%;
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% { 
    left: 150%;
    opacity: 0;
  }
}

nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: block;
}

.nav-links a:hover {
  color: var(--accent);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  list-style: none;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu a {
  padding: 0.75rem 1.25rem;
  display: block;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background: rgba(0,102,204,0.2);
}

.disabled a {
  opacity: 0.5;
  cursor: not-allowed;
}

.disabled a:hover {
  background: transparent !important;
  color: var(--text-muted) !important;
  transform: none !important;
}

.nav-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  padding: 0.6rem 1.5rem !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 15px rgba(0,102,204,0.4);
}

.nav-button:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 20px rgba(0,102,204,0.6);
}

header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem 2rem;
  background: radial-gradient(ellipse at center, rgba(0,102,204,0.1) 0%, transparent 70%);
}

.server-logo img {
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0,255,255,0.3));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.player-status {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

#player-count {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.3rem;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.download-buttons {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
  gap: 20px;
}

.main-download-btn {
  padding: 1.5rem 3rem;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  color: white;
  background: linear-gradient(135deg, var(--primary), #004488);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 
    0 8px 25px rgba(0,102,204,0.5),
    0 0 30px rgba(0,255,255,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.main-download-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

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

.main-download-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 
    0 15px 35px rgba(0,102,204,0.7),
    0 0 50px rgba(0,255,255,0.4);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.main-download-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.server-info {
  text-align: center;
  margin: 4rem 0;
  padding: 2rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, rgba(30,144,255,0.2), rgba(0,85,170,0.2));
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0,255,255,0.2);
}

.btn:hover {
  background: linear-gradient(135deg, rgba(30,144,255,0.3), rgba(0,85,170,0.3));
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0,255,255,0.4);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  color: white;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.close-btn:hover {
  color: white;
  transform: rotate(90deg);
  background: rgba(255,255,255,0.1);
}

.textured-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.launcher-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.launcher-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.launcher-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0,102,204,0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.launcher-card:hover::before {
  opacity: 1;
}

.launcher-card:hover {
  background: rgba(0,102,204,0.2);
  transform: translateY(-8px);
  box-shadow: 
    0 15px 30px rgba(0,102,204,0.5),
    0 0 40px rgba(0,255,255,0.2);
  border-color: var(--primary);
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-content label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-content input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 20px rgba(0,102,204,0.3);
}

.modal-content button[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-content button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,102,204,0.6);
}

.modal-content p {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
}

.modal-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.modal-content a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

#login-error, #register-error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(239,68,68,0.1);
  border-radius: 8px;
  border-left: 3px solid var(--error);
}

.account-menu {
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 16px;
  min-width: 280px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.account-menu:hover .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown p {
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

.account-dropdown span {
  color: var(--accent);
  font-weight: 600;
}

#logoutBtn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239,68,68,0.2);
  border: 1px solid var(--error);
  color: var(--error);
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#logoutBtn:hover {
  background: var(--error);
  color: white;
  transform: translateY(-2px);
}

footer {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem 2rem;
  text-align: center;
  margin-top: 5rem;
}

footer p {
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

footer a {
  color: var(--text);
  text-decoration: none;
  margin: 0 0.75rem;
  transition: color 0.3s ease;
  font-weight: 500;
}

footer a:hover {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 3000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
  }
  
  .server-logo img {
    max-width: 200px;
  }
  
  .main-download-btn {
    font-size: 1.1rem;
    padding: 1.2rem 2rem;
  }
}

/* =========================================================
   PATCHNOTES
   ========================================================= */

.patchnotes-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
}

/* Carte */

.patch-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border: 1px solid var(--glass-border);
  border-radius: 18px;

  padding: 1.5rem 1.75rem;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.05);

  overflow: hidden;

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.patch-card::before {
  content: "";

  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 2px;

  background: linear-gradient(
    90deg,
    transparent,
    var(--primary),
    var(--accent),
    transparent
  );

  opacity: 0.7;
}

.patch-card:hover {
  transform: translateY(-4px);

  border-color: rgba(0, 255, 255, 0.25);

  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(0, 255, 255, 0.08);
}


/* =========================================================
   HEADER DU PATCH
   ========================================================= */

.patch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;

  margin-bottom: 1.25rem;
  padding-bottom: 1rem;

  border-bottom: 1px solid var(--glass-border);
}

.patch-header h3 {
  margin: 0;

  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;

  background: linear-gradient(
    135deg,
    var(--primary-light),
    var(--accent)
  );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.patch-date {
  flex-shrink: 0;

  color: var(--text-muted);
  font-size: 0.8rem;

  padding: 0.4rem 0.7rem;

  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);

  border-radius: 8px;
}


/* =========================================================
   CONTENU
   ========================================================= */

.patch-content {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.patch-line {
  padding: 0.75rem 1rem;

  color: var(--text-muted);

  background: rgba(255,255,255,0.025);

  border-left: 3px solid rgba(255,255,255,0.1);
  border-radius: 0 8px 8px 0;

  line-height: 1.5;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.patch-line:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(3px);
}


/* =========================================================
   TYPES DE MODIFICATIONS
   ========================================================= */

.patch-line.add {
  border-left-color: var(--success);
  background: rgba(67, 233, 123, 0.055);
}

.patch-line.add:hover {
  background: rgba(67, 233, 123, 0.09);
}

.patch-line.mod {
  border-left-color: var(--primary-light);
  background: rgba(0, 136, 255, 0.055);
}

.patch-line.mod:hover {
  background: rgba(0, 136, 255, 0.09);
}

.patch-line.improve {
  border-left-color: var(--accent);
  background: rgba(0, 255, 255, 0.045);
}

.patch-line.improve:hover {
  background: rgba(0, 255, 255, 0.08);
}

.patch-line.move {
  border-left-color: #a78bfa;
  background: rgba(167, 139, 250, 0.055);
}

.patch-line.move:hover {
  background: rgba(167, 139, 250, 0.09);
}

.patch-line.remove {
  border-left-color: var(--error);
  background: rgba(239, 68, 68, 0.055);
}

.patch-line.remove:hover {
  background: rgba(239, 68, 68, 0.09);
}

.patch-line.look {
  border-left-color: #facc15;
  background: rgba(250, 204, 21, 0.045);
}

.patch-line.look:hover {
  background: rgba(250, 204, 21, 0.08);
}


/* =========================================================
   MARKDOWN
   ========================================================= */

.patch-line strong {
  color: white;
  font-weight: 700;
}

.patch-line em {
  color: var(--text);
}

.patch-line code {
  padding: 0.15rem 0.4rem;

  background: rgba(0,0,0,0.35);

  border: 1px solid var(--glass-border);
  border-radius: 5px;

  color: var(--accent);

  font-family: monospace;
  font-size: 0.9em;
}

.patch-line a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;

  transition: color 0.2s ease;
}

.patch-line a:hover {
  color: var(--accent);
  text-decoration: underline;
}


/* =========================================================
   ERREURS / VIDE
   ========================================================= */

.patchnotes-error,
.patchnotes-empty {
  width: 100%;

  padding: 2rem;

  text-align: center;

  background: var(--glass-bg);
  backdrop-filter: blur(20px);

  border: 1px solid var(--glass-border);
  border-radius: 16px;

  color: var(--text-muted);
}

.patchnotes-error {
  border-left: 4px solid var(--error);
}

.patchnotes-error strong {
  display: block;

  color: var(--error);

  margin-bottom: 0.5rem;
}

.patchnotes-error small {
  color: var(--text-muted);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

  .patchnotes-grid {
    margin: 1.5rem auto;
  }

  .patch-card {
    padding: 1.2rem;
    border-radius: 14px;
  }

  .patch-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .patch-header h3 {
    font-size: 1.15rem;
  }

  .patch-date {
    font-size: 0.75rem;
  }

  .patch-line {
    padding: 0.65rem 0.8rem;
    font-size: 0.9rem;
  }
}
