body {
  margin: 0;
  overflow: hidden;
  background-color: #000;
  font-family: 'Reem Kufi Fun', sans-serif;
}

#viewport {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  cursor: grab;
}

#map-container {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  z-index: 1;
  will-change: transform;
}

#map-image {
  filter: brightness(0.6) contrast(1.1) saturate(0.9);
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  display: block;
}

#night-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
  z-index: 1.5;
}

#toggle-theme {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s;
  filter: drop-shadow(0 0 5px #ffffffaa);
}

#toggle-theme:hover {
  transform: scale(1.1);
}

.gate {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}

.gate img {
  width: 80px;
  transition: transform 0.3s;
  cursor: pointer;
  filter: grayscale(100%) brightness(0.8);
  animation: aura 4s infinite ease-in-out;
  pointer-events: auto !important;
  cursor: pointer;
}

.gate:hover img {
  transform: scale(1.1);
}

.coming-soon {
  position: relative;
  margin-top: 5px;
}

.coming-soon span {
  font-size: 14px;
  color: #00e5ff;
  text-shadow:
    1px 1px 0 #000,
   -1px 1px 0 #000,
    1px -1px 0 #000,
   -1px -1px 0 #000,
    0 0 6px #00e5ff,
    0 0 10px #00bcd4;
  animation: glow-text 2s ease-in-out infinite;
}

/* زرّين تسجيل الدخول والتسجيل */
.auth-buttons {
  position: absolute;
  display: flex;
  flex-direction: row;
  gap: 16px;
  z-index: 999;
  font-size: 0;
}

@media (min-width: 769px) {
  .auth-buttons {
    top: 10px;
    left: 10px;
  }

  .auth-wrapper {
    width: 148px;
    height: 137px;
  }
}

@media (max-width: 768px) {
  .auth-buttons {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    justify-content: center;
    padding: 0 10px;
    box-sizing: border-box;
    width: 100%;
  }

  .auth-wrapper {
    flex: 1;
    max-width: 200px;
    height: 180px;
    position: relative;
  }

  .btn-auth span {
    font-size: 14px;
  }
}

.auth-wrapper {
  position: relative;
}

.btn-auth {
  width: 100%;
  height: 100%;
  background: url("/assets/magic_button.png") no-repeat center center;
  background-size: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  position: relative;
}

.btn-auth span {
  font-size: 16px;
  font-weight: bold;
  color: #fffce0;
  font-family: 'Georgia', serif;
  text-shadow: 1px 1px 2px #000;
  z-index: 2;
}

.btn-auth::after {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.25), transparent 70%);
  border-radius: 50%;
  animation: softPulse 3s ease-in-out infinite;
  filter: blur(12px);
  z-index: 0;
}

.btn-auth::before {
  content: "";
  position: absolute;
  top: -15px;
  left: -15px;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 230, 120, 0.15) 10%, transparent 70%);
  animation: glowParticles 3s infinite linear;
  border-radius: 50%;
  z-index: 0;
  filter: blur(8px);
}

.btn-auth:hover {
  transform: scale(1.03);
}

.particles-box {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* أوراق الشجر */
.leaf-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.leaf {
  position: absolute;
  top: -60px;
  width: 32px;
  height: 32px;
  animation: fall 10s linear infinite;
  animation-delay: calc(var(--i) * 2s);
  opacity: 0.8;
  pointer-events: none;
}

/* معلومات المستخدم بعد تسجيل الدخول */
.auth-user-info {
  position: fixed !important;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 14px 18px;
  border-radius: 24px;
  background: rgba(22, 15, 40, 0.92);
  backdrop-filter: blur(14px);
  border: 2.5px solid #a85be3;
  box-shadow: 0 2px 30px #b174e67a;
  z-index: 12000;
  font-family: 'Reem Kufi Fun', 'Tajawal', sans-serif;
}

.auth-user-info button,
.auth-user-info a.topbar-btn {
  background-color: #8e44ad;
  color: #fff;
  padding: 10px 0;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.13s;
  text-decoration: none;
  display: inline-block;
  min-width: 160px;
  text-align: center;
  margin: 0 7px;
}

.auth-user-info button:hover,
.auth-user-info a.topbar-btn:hover {
  background-color: #732d91;
  color: #ffe3a1;
  transform: scale(1.04);
}

.auth-user-info span {
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
  margin: 0 7px;
}

.auth-user-info img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  margin-right: 2px;
}

@media (max-width: 850px) {
  .auth-user-info {
    flex-direction: column;
    gap: 9px;
    padding: 12px 8px;
    width: 98vw;
    border-radius: 18px;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
  }
  .auth-user-info button,
  .auth-user-info a.topbar-btn {
    min-width: 120px;
    width: 98%;
    margin: 0;
  }
}


@keyframes fall {
  0% {
    transform: translateY(-60px) rotate(0deg);
    left: calc(10% + 20% * var(--i));
    opacity: 1;
  }
  50% {
    transform: translateY(50vh) rotate(180deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes glowParticles {
  0% { transform: scale(1) translate(0, 0); opacity: 0.3; }
  50% { transform: scale(1.05) translate(2px, -2px); opacity: 0.5; }
  100% { transform: scale(1) translate(0, 0); opacity: 0.3; }
}

@keyframes softPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.6; }
}

@keyframes glow-text {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes aura {
  0%, 100% { filter: drop-shadow(0 0 5px #00ffff); }
  50% { filter: drop-shadow(0 0 15px #00ffff); }
}
