#login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 640px;
  min-height: 480px;
}

#login-wrapper #login-inner {
  justify-content: center;
  position: relative;
  height: 100%;
  min-width: 640px;
  min-height: 480px;
  display: flex;
}

#login-wrapper #login-inner img {
  height: 100%;
}

#login-wrapper #login-inner .login-settings button {
  margin: 4px;
  width: 108px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  color: #ddd;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

#login-wrapper #login-inner .login-settings button:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: #888;
  color: #fff;
}

#login-wrapper #login-inner .login-settings {
  border: 1px solid rgba(100, 100, 100, 0.5);
  border-radius: 8px;
  position: absolute;
  left: 32px;
  bottom: 32px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  width: 116px;
}

#login-wrapper #login-inner .login-version {
  position: absolute;
  width: auto;
  top: 4px;
  left: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

/* Modal styling */
.modal-wrapper .modal {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.modal-wrapper .modal .modal-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(100, 100, 255, 0.15);
}

.modal-wrapper .modal .modal-body {
  background: rgba(15, 15, 25, 0.92);
  padding: 16px;
}

/* Login input fields */
.login-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(30, 30, 50, 0.8);
  color: #e0e0e0;
  border: 1px solid rgba(100, 100, 150, 0.3);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  text-align: center;
}

.login-input:focus {
  border-color: rgba(120, 100, 255, 0.6);
  box-shadow: 0 0 8px rgba(120, 100, 255, 0.15);
}

.login-input::placeholder {
  color: rgba(150, 150, 180, 0.5);
}

/* Keep backward compat */
.password-input {
  text-align: center;
}

.input-label {
  color: #aab;
  font-size: 12px;
  margin-bottom: 2px;
}

/* Wallet button */
.btn-wallet {
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.25s;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-wallet:hover {
  background: linear-gradient(135deg, #6d28d9, #9333ea);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.btn-wallet .btn-icon {
  font-size: 16px;
  margin-right: 4px;
}

/* Discord button */
.btn-discord {
  width: 100%;
  padding: 9px 0;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
  background: #4752c4;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}

/* Enter game button */
.btn-enter {
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s;
}

.btn-enter:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857, #059669);
  transform: translateY(-1px);
}

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

/* Login divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.login-divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid rgba(100, 100, 150, 0.3);
}

.login-divider span {
  font-size: 11px;
  color: rgba(150, 150, 180, 0.6);
  white-space: nowrap;
}

/* ======================================
   Mobile Responsive — Login Screen
   ====================================== */
@media screen and (max-width: 768px), screen and (max-height: 500px) {
  #login-wrapper {
    min-width: unset;
    min-height: unset;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    background: #0a0a0a;
    overflow: hidden;
  }

  #login-wrapper #login-inner {
    min-width: unset;
    min-height: unset;
    width: 100%;
    height: 100%;
    background: url('../png/background.webp') center center / cover no-repeat #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #login-wrapper #login-inner img {
    display: none;
  }

  #login-wrapper #login-inner .modal-wrapper {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
  }

  #login-wrapper #login-inner .modal-wrapper .modal {
    position: relative !important;
    width: 100%;
    max-width: 360px;
  }

  #login-wrapper #login-inner .modal-wrapper .modal .modal-body {
    min-width: unset !important;
    max-width: unset !important;
  }

  /* Center login buttons at bottom */
  #login-wrapper #login-inner .login-settings {
    position: relative;
    left: unset;
    bottom: unset;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: transparent;
    border: none;
    backdrop-filter: none;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  #login-wrapper #login-inner .login-settings button {
    flex: 1;
    min-width: 100px;
    height: 40px;
  }

  #login-wrapper #login-inner .login-version {
    position: relative;
    left: unset;
    top: unset;
    text-align: center;
    padding: 12px 0 4px 0;
    font-size: 9px;
  }

  .btn-wallet, .btn-discord, .btn-enter {
    padding: 12px 0;
    font-size: 14px;
    min-height: 44px;
  }

  .login-input {
    padding: 10px 12px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}
