.edit-modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.7);
   /* dimmed background */
   display: flex;
   justify-content: center;
   align-items: center;
   z-index: 1111;
}

.edit-modal.hidden {
   display: none;
}

.edit-modal-content {
   background-color: rgba(0, 0, 0, 0.9);
   color: #fff;
   padding: 20px 30px;
   border-radius: 6px;
   width: 100%;
   max-width: 350px;
   box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
   flex-direction: column;
   font-family: system-ui, sans-serif;
}

.edit-modal-content h3 {
   margin-top: 0;
   font-size: 20px;
   margin-bottom: 30px;
   text-align: center;
}

.edit-modal-content h4 {
   margin-top: 25px;
   font-size: 16px;
   text-align: left;
   margin-bottom: 5px;
}

.edit-input-wrapper {
   position: relative;
   margin-bottom: -2px;
}

.edit-input-wrapper input {
   width: 100%;
   padding: 10px;
   border-radius: 6px;
   border: 1px solid #ccc;
   font-size: 14px;
   box-sizing: border-box;
}

.edit-input-wrapper label {
   position: absolute;
   top: 44%;
   left: 8px;
   transform: translateY(-50%);
   color: #aaa;
   font-size: 14px;
   pointer-events: none;
   transition: 0.2s ease all;
   background: transparent;
   /* darker background for contrast */
   padding: 0 2px;
}

.edit-input-wrapper input:focus+label,
.edit-input-wrapper input:not(:placeholder-shown)+label {
   top: -8px;
   left: 2px;
   font-size: 12px;
   background: transparent;
   color: white;
}

#leagueNameEdit {
   width: 100%;
   padding: 8px;
   margin-top: 2px;
   margin-bottom: 5px;
   border-radius: 6px;
   border: 1px solid rgba(255, 255, 255, 0.1);
   font-size: 14px;
   box-sizing: border-box;
   background: rgba(255, 255, 255, 0.03);
   color: #f0f0f0;
   backdrop-filter: blur(4px);
   box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.05);
}

.edit-error {
   color: red;
   font-size: 12px;
   margin: 0;
   /* ⬅️ removes vertical space */
   line-height: 1.2;
   /* consistent height if shown */
   min-height: 16px;
}

.user-list {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-bottom: 20px;
}

#accessUsersContainer,
#friendsListContainer {
   max-height: 40px;
   min-height: 25px;
   overflow-y: auto;
   padding: 6px;
   margin-top: 6px;
   border-radius: 6px;
   background: rgba(255, 255, 255, 0.04);
   /* translucent dark */
   color: #f0f0f0;
   line-height: 1.2;
   border: 1px solid rgba(255, 255, 255, 0.1);
   box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.05);
   backdrop-filter: blur(4px);
}

.user-pill {
   display: inline-flex;
   align-items: center;
   background-color: #444;
   color: white;
   padding: 4px 8px;
   border-radius: 6px;
   margin: 1px;
   font-size: 12px;
}

.user-pill .remove-btn {
   margin-left: 8px;
   color: #ff4d4d;
   font-weight: bold;
   cursor: pointer;
}

.remove-btn {
   margin-left: 6px;
   cursor: pointer;
   color: red !important;
   font-weight: bold;
   font-family: inherit;
   font-size: 14px;
   line-height: 1;
}


.add-friend-btn {
   display: inline-block;
   margin: 1px;
   padding: 6px 10px;
   font-size: 12px;
   cursor: pointer;
   background-color: #2a2a2a;
   color: white;
   border: 1px solid #555;
   border-radius: 6px;
}


.add-friend-btn:hover:not(:disabled) {
   background-color: #1ab914;
}

.add-friend-btn:disabled {
   opacity: 0.5;
   cursor: not-allowed;
   background-color: #1d1d1d;
   color: rgb(83, 83, 83);
   border: 1px solid #555;
}

.edit-modal-buttons {
   display: flex;
   justify-content: space-between;
   margin-top: 40px;
   margin-bottom: 10px;
   gap: 12px;
}

.confirm-edit-btn {
   padding: 10px 18px;
   font-size: 14px;
   border-radius: 6px;
   border: none;
   cursor: pointer;
   width: 50%;
}

.confirm-edit-btn {
   background-color: #218838;
   color: white;
}

.confirm-edit-btn:hover {

   background-color: #28a745;
   transform: scale(1.03);
}

.no-access-msg,
.no-friend-msg {
   color: rgb(122, 116, 116);
   font-size: 14px;
   font-weight: bold;
   text-align: center;
   margin-top: 4px;
   width: 100%;
   box-sizing: border-box;
}

@media (max-width: 480px) {

   .edit-modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      justify-content: center;
      align-items: center;
      padding: 8px;
      box-sizing: border-box;
      display: flex;
   }

   .edit-modal.hidden {
      display: none;
   }

   .edit-modal-content {
      padding: 16px 30px;
      border-radius: 6px;
      width: 100%;
      max-width: 280px;
      position: relative;
      display: flex;
   }

   #leagueNameEdit {
      font-size: 12px;
      bottom: 10px;
   }

   .edit-modal-content h3 {
      font-size: 16px;
   }

   .edit-modal-content h4 {
      font-size: 14px;
   }

   .remove-btn {
      margin-left: 6px;
      cursor: pointer;
      color: red;
      font-weight: bold;
   }

   .edit-modal-buttons {
      margin-top: 30px;
      margin-bottom: 10px;
      gap: 12px;
   }

   .no-access-msg,
   .no-friend-msg {
      color: rgb(122, 116, 116);
      font-size: 12px;
      font-weight: bold;
      text-align: center;
      width: 100%;
      margin-top: 4px;
      box-sizing: border-box;
      position: relative;
   }
}