/* ===================================================== */
/* LOGIN OVERLAY */
/* ===================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background: url("/assets/locations/loginscreen.png") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease;
  overflow: hidden;
  animation: loginBgMove 80s ease-in-out infinite alternate;
}

@keyframes loginBgMove {
  from { background-size: 100%; }
  to { background-size: 108%; }
}

.login-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.02) 26%,
    rgba(0,0,0,0.28) 62%,
    rgba(0,0,0,0.64) 100%
  );
  pointer-events: none;
}

.login-overlay::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 40%, rgba(255,255,255,0.05), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(255,255,255,0.04), transparent 45%);
  animation: fogMove 60s linear infinite;
  pointer-events: none;
}

@keyframes fogMove {
  from { transform: translateX(-5%) translateY(-3%) scale(1.05); }
  to   { transform: translateX(5%) translateY(3%) scale(1.1); }
}

.login-fade-out {
  opacity: 0;
}

.login-overlay-footer {
  position: absolute;
  inset: auto 0 22px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 4;
}

.login-footer-left {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.login-studio-badge,
.login-version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: rgba(245, 238, 220, 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.login-studio-badge-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.74;
  filter:
    drop-shadow(0 5px 14px rgba(0, 0, 0, 0.45))
    saturate(0.92);
}

.login-version-badge {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.88;
}

.login-music-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14, 12, 9, 0.62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.login-music-label,
.login-music-value {
  color: rgba(245, 238, 220, 0.8);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-music-value {
  min-width: 48px;
  text-align: center;
}

.login-music-btn {
  width: auto;
  min-width: 42px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #f7edd2;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.login-music-btn:hover {
  transform: translateY(-1px);
  background: rgba(214, 187, 106, 0.14);
  border-color: rgba(214, 187, 106, 0.24);
}

/* ===================================================== */
/* STAGE WRAPPER */
/* ===================================================== */

.login-box {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  animation: none;
}

/* ===================================================== */
/* FREE FLOATING LOGO */
/* ===================================================== */

.login-box::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(440px, 70vw);
  height: clamp(140px, 18vw, 800px);
  transform: translate(-50%, calc(-50% - 145px));
  background: url("/assets/ui/logo.png") center/contain no-repeat;
  filter:
    drop-shadow(0 12px 28px rgba(0,0,0,0.50))
    drop-shadow(0 0 20px rgba(210,170,95,0.18));
  pointer-events: none;
  z-index: 2;
}

/* ===================================================== */
/* HIDE OLD LOGIN ELEMENTS */
/* ===================================================== */

.guild-emblem,
.game-title,
.login-subtitle {
  display: none !important;
}

/* ===================================================== */
/* ACTUAL LOGIN PANEL */
/* ===================================================== */

.login-box > * {
  position: relative;
  z-index: 3;
}

.login-box form,
.login-box .login-panel,
.login-box .login-actions,
.login-box .login-content,
.login-box .login-inner {
  width: min(420px, 88vw);
}

/* Fallback: style the direct content area generically */
.login-box > div,
.login-box > form {
  width: min(420px, 88vw);
  margin-top: 170px;
  padding: 26px 26px 24px;
  border-radius: 18px;
  background: rgba(18,18,18,0.48);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.46),
    inset 0 0 0 1px rgba(255,255,255,0.03);
}

/* If inputs exist later, they still look clean */
.login-box input {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 13px;
  background: rgba(20,20,20,0.92);
  border: 1px solid rgba(255,255,255,0.14);
  color: white;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.login-box input:focus {
  outline: none;
  border-color: #c8a85a;
  box-shadow: 0 0 8px rgba(200,170,90,0.34);
}

/* ===================================================== */
/* BUTTON */
/* ===================================================== */

.login-box button {
  width: 100%;
  margin-top: 0;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.enter-world-btn {
  animation: enterPulse 4s ease-in-out infinite;
}

@keyframes enterPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.enter-world-btn:hover {
  transform: translateY(-1px) scale(1.01);
}

/* ===================================================== */
/* ERROR */
/* ===================================================== */

.login-error {
  color: #ff8080;
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}

/* ===================================================== */
/* GAME UI VISIBILITY CONTROL */
/* ===================================================== */

.app-hidden {
  opacity: 0;
  pointer-events: none;
}

.app-visible {
  opacity: 1;
  transition: opacity 0.8s ease;
}

/* ===================================================== */
/* FIREFLIES */
/* ===================================================== */

.fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe8a3;
  box-shadow:
    0 0 6px rgba(255,230,140,0.8),
    0 0 12px rgba(255,210,100,0.6);
  opacity: 0;
  animation: fireflyFloat linear infinite;
}

@keyframes fireflyFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-300px) translateX(60px);
    opacity: 0;
  }
}

/* ===================================================== */
/* MOBILE */
/* ===================================================== */

@media (max-width: 640px) {
  .login-box::before {
    width: min(360px, 78vw);
    height: clamp(110px, 24vw, 180px);
    transform: translate(-50%, calc(-50% - 120px));
  }

  .login-box > div,
  .login-box > form {
    width: min(88vw, 360px);
    margin-top: 135px;
    padding: 20px 18px 18px;
    border-radius: 16px;
  }

  .login-box button {
    font-size: 16px;
    padding: 13px 16px;
  }

  .login-overlay-footer {
    inset: auto 0 16px 0;
    padding: 0 16px;
    align-items: stretch;
    gap: 12px;
  }

  .login-studio-badge-icon {
    width: 40px;
    height: 40px;
  }

  .login-version-badge {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .login-footer-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .login-music-controls {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }

  .login-music-label,
  .login-music-value {
    font-size: 11px;
  }
}
